diff options
author | Brahmajit Das <brahmajit.xyz@gmail.com> | 2023-05-14 09:59:58 +0530 |
---|---|---|
committer | Brahmajit Das <brahmajit.xyz@gmail.com> | 2023-05-14 10:15:07 +0530 |
commit | 4fc04fea1755c3c4f8913877c2c1889779d3d4d1 (patch) | |
tree | 329b30269fdec97e85f6e52d74d696cb57d6a194 /meson.build | |
parent | 11d90648022edb45fbabf43f0f64809ed53aeeab (diff) | |
download | tracker-4fc04fea1755c3c4f8913877c2c1889779d3d4d1.tar.gz |
build: Define _GNU_SOURCE for gmtime_r
Found while building tracker 3.5.2 with clang 16, which enable
Wimplicit-function-declaration by default.
Without _GNU_SOURCE defined, tracker would fail in the configure phase
with Checking if "strftime 4-digit year modifier" runs: DID NOT
COMPILE error. And investigating the meson log we see
Compiler stderr:
/var/tmp/portage/app-misc/tracker-3.5.2/work/tracker-3.5.2-build/meson-private/tmplr2vm6b0/testfile.c:12:5: error: call to undeclared function 'gmtime_r'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
gmtime_r (×tamp, &tm);
And a little further up
Command line: clang /var/tmp/portage/app-misc/tracker-3.5.2/work/tracker-3.5.2-build/meson-private/tmplr2vm6b0/testfile.c -o /var/tmp/portage/app-misc/tracker-3.5.2/work/tracker-3.5.2-build/meson-private/tmplr2vm6b0/output.exe -O2 -pipe -march=native -DTRACKER_DEBUG -DG_DISABLE_CAST_CHECKS -D_FILE_OFFSET_BITS=64 -O0 -Werror=implicit-function-declaration -std=c99 -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed
Seems like cc.run() doesn't pick up the general compiler args we set
earlier. We have already set it for the main build, so adding it just
for the configure test should be fine.
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/meson.build b/meson.build index 7b22cb1f9..00af07e6e 100644 --- a/meson.build +++ b/meson.build @@ -202,6 +202,7 @@ endif # Get an appropriate 4-digit year modifier for strftime ################################################################## result = cc.run(''' + #define _GNU_SOURCE #include <stdio.h> #include <string.h> #include <time.h> |