diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b13664e1..54d9a161e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -330,7 +330,6 @@ check_include_file("sys/mount.h" HAVE_SYS_MOUNT_H) check_include_file("sys/statvfs.h" HAVE_SYS_STATVFS_H) check_include_file("inttypes.h" HAVE_INTTYPES_H) check_include_file("stdint.h" HAVE_STDINT_H) -check_include_file("sys/capability.h" HAVE_SYS_CAPABILITY_H) check_include_file("arpa/inet.h" HAVE_ARPA_INET_H) check_include_file("netinet/tcp.h" HAVE_NETINET_TCP_H) check_include_file("sys/ioctl.h" HAVE_SYS_IOCTL_H) @@ -345,6 +344,9 @@ check_include_file("sys/socket.h" HAVE_SYS_SOCKET_H) check_include_file("sys/wait.h" HAVE_SYS_WAIT_H) check_include_file("sys/un.h" HAVE_SYS_UN_H) check_include_file("spawn.h" HAVE_SPAWN_H) +if(OS_LINUX) + check_include_file("sys/capability.h" HAVE_SYS_CAPABILITY_H) +endif() # # check symbols @@ -448,6 +450,15 @@ int main() { } " HAVE_BUILTIN_ATOMICS) +check_cxx_source_compiles(" +#include <stdint.h> +int main(void) { + uint64_t a; + __sync_add_and_fetch(&a, 1); + return 0; +} +" ARCH_SUPPORTS_64BIT_ATOMICS) + check_c_source_compiles(" void my_printf(char const *s, ...) __attribute__((format(gnu_printf, 1, 2))); int main() { return 0; } @@ -1528,6 +1539,8 @@ if(ENABLE_H2O) target_compile_options(h2o PUBLIC -DH2O_USE_LIBUV=0) target_link_libraries(h2o PRIVATE PkgConfig::TLS) + target_compile_definitions(h2o PRIVATE + "$<$<NOT:$<BOOL:${ARCH_SUPPORTS_64BIT_ATOMICS}>>:H2O_NO_64BIT_ATOMICS>") endif() # |