[libcamera-devel] [PATCH] meson: Update min clang version to 9

Paul Elder paul.elder at ideasonboard.com
Mon Aug 2 11:40:45 CEST 2021


__builtin_FILE and __builtin_LINE are first defined in clang 9. With
clang of any version less than that we have the following compilation
errors:

../../include/libcamera/base/log.h:94:27: error: use of undeclared identifier '__builtin_FILE'
                        const char *fileName = __builtin_FILE(),
                                               ^
../../include/libcamera/base/log.h:95:24: error: use of undeclared identifier '__builtin_LINE'
                        unsigned int line = __builtin_LINE()) const;
                                            ^
../../include/libcamera/base/log.h:99:26: error: use of undeclared identifier '__builtin_FILE'
                const char *fileName = __builtin_FILE(),
                                       ^
../../include/libcamera/base/log.h:100:23: error: use of undeclared identifier '__builtin_LINE'
                unsigned int line = __builtin_LINE());

Enforce clang version of at least 9 in the main meson file.

Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
---
 meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/meson.build b/meson.build
index 6eed0d8c..a49c484f 100644
--- a/meson.build
+++ b/meson.build
@@ -50,8 +50,8 @@ c_arguments = []
 cpp_arguments = []
 
 if cc.get_id() == 'clang'
-    if cc.version().version_compare('<5')
-        error('clang version is too old, libcamera requires 5.0 or newer')
+    if cc.version().version_compare('<9')
+        error('clang version is too old, libcamera requires 9.0 or newer')
     endif
 
     # Turn _FORTIFY_SOURCE by default on optimised builds (as it requires -O1
-- 
2.27.0



More information about the libcamera-devel mailing list