Commit graph

11 commits

Author SHA1 Message Date
badaix
8c6d703ec5 Update copyright dates 2020-01-04 01:03:48 +01:00
Szabolcs Hubai
c1a2fedd8d cmake: set CMAKE_CXX_LINK_FLAGS in CheckAtomic module
The checks are valid, the "atomic" is added to CMAKE_REQUIRED_LIBRARIES,
but it fails during linking with undefined reference to __atomic_store_8
error.

"-latomic" needs to be added to CMAKE_CXX_LINK_FLAGS to fix that.
2019-11-04 14:37:35 +01:00
Szabolcs Hubai
e177689426 cmake: fix test HAVE_CXX_LIBATOMICS64_2ARGS in CheckAtomic module
It's no sense to repeat an already failed check.
Looks like a copy-paste bug as the HAVE_CXX_LIBATOMICS64_2ARGS test
runs again the very same check as the HAVE_LIBATOMIC_2ARGS.

Without this change the check obviously fails:

-- Performing Test HAVE_LIBATOMIC_2ARGS
-- Performing Test HAVE_LIBATOMIC_2ARGS - Failed
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB - Failed
-- Looking for __atomic_load_8 in atomic
-- Looking for __atomic_load_8 in atomic - not found
-- Performing Test HAVE_CXX_LIBATOMICS64_2ARGS
-- Performing Test HAVE_CXX_LIBATOMICS64_2ARGS - Failed
CMake Error at cmake/CheckAtomic.cmake:146 (message):
  Host compiler appears to require libatomic, but cannot find it.
Call Stack (most recent call first):
  CMakeLists.txt:80 (include)

With this change the test HAVE_CXX_LIBATOMICS64_2ARGS succeeds:

-- Performing Test HAVE_LIBATOMIC_2ARGS
-- Performing Test HAVE_LIBATOMIC_2ARGS - Failed
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS64_WITHOUT_LIB - Failed
-- Looking for __atomic_load_8 in atomic
-- Looking for __atomic_load_8 in atomic - not found
-- Performing Test HAVE_CXX_LIBATOMICS64_2ARGS
-- Performing Test HAVE_CXX_LIBATOMICS64_2ARGS - Success
-- Performing Test HAVE_CXX_ATOMICS64_WITH_LIB
-- Performing Test HAVE_CXX_ATOMICS64_WITH_LIB - Success
2019-11-04 14:37:35 +01:00
Szabolcs Hubai
5c4174cfc1 cmake: use 'long long' for atomic check
Use 'long long' in the check_working_cxx_atomics check.
Without it the check succeed but fails during linking:

-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB
-- Performing Test HAVE_CXX_ATOMICS_WITHOUT_LIB - Success

Tested with the following toolchains with OpenWrt:
* toolchain-aarch64_cortex-a72_gcc-8.3.0_musl
* toolchain-arm_cortex-a7+neon-vfpv4_gcc-8.3.0_musl_eabi
* toolchain-i386_pentium_gcc-8.3.0_musl
* toolchain-mips_24kc_gcc-8.3.0_musl
* toolchain-mipsel_24kc_gcc-8.3.0_musl
2019-11-04 14:37:35 +01:00
badaix
7d8e77cfc0 check for 32bit lib atomic 2019-10-28 21:19:48 +01:00
badaix
64c78d1a14 add CheckAtomic cmake module 2019-10-28 19:18:01 +01:00
badaix
b20add3815 add clang-format file
reformat code
2019-09-24 22:42:36 +02:00
badaix
1299fc44fc remove include guard 2018-04-26 15:56:05 +02:00
badaix
2896ff7bf6 add documentation for CheckCXX11StringSupport 2018-04-25 16:57:44 +02:00
badaix
14e033a677 cmake checks for c++11 string support 2018-04-25 16:41:59 +02:00
Jörg Krause
0dd803007a Initial CMake support 2018-02-03 21:29:45 +01:00