diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-07-20 13:56:59 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-07-20 13:56:59 +0200 |
commit | 77015e8132556e335aeadf0124b80b3fd3f1799f (patch) | |
tree | 1fdbb274daefdc2bc542d1e3b04716660e91e210 /CMakeLists.txt | |
parent | Merge pull request #902 (diff) | |
parent | cmake: don't try to link with atomic on Apple (diff) | |
download | monero-77015e8132556e335aeadf0124b80b3fd3f1799f.tar.xz |
Merge pull request #904
f07f120 cmake: don't try to link with atomic on Apple (redfish)
19349d7 cmake: ARM: clang: make warning non-fatal: inline asm (redfish)
f3e09f3 cmake: link with -latomic for clang (redfish)
f4b35ae cmake: include -ldl via cmake built-in var (redfish)
fa85cd8 common: stack trace: make clang happy with func ptrs (redfish)
4dce26b cmake: do not pass -stdlib=c++ to clang >=3.7 (redfish)
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ce9bb7af..46c5b2e1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -323,6 +323,9 @@ else() endif() if(CMAKE_C_COMPILER_ID STREQUAL "Clang") set(WARNINGS "${WARNINGS} -Wno-error=mismatched-tags -Wno-error=null-conversion -Wno-overloaded-shift-op-parentheses -Wno-error=shift-count-overflow -Wno-error=tautological-constant-out-of-range-compare -Wno-error=unused-private-field -Wno-error=unneeded-internal-declaration") + if(ARM6 OR ARM7) + set(WARNINGS "${WARNINGS} -Wno-error=inline-asm") + endif() else() set(WARNINGS "${WARNINGS} -Wlogical-op -Wno-error=maybe-uninitialized") endif() @@ -397,8 +400,10 @@ else() # There is a clang bug that does not allow to compile code that uses AES-NI intrinsics if -flto is enabled, so explicitly disable set(USE_LTO false) # explicitly define stdlib for older versions of clang - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") + if(CMAKE_C_COMPILER_VERSION VERSION_LESS 3.7) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") + endif() endif() @@ -458,9 +463,11 @@ elseif(NOT MSVC) set(EXTRA_LIBRARIES ${RT}) endif() -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND NOT MINGW) - find_library(DL dl) - set(EXTRA_LIBRARIES ${DL}) +list(APPEND EXTRA_LIBRARIES ${CMAKE_DL_LIBS}) + +if(NOT MINGW AND NOT APPLE) + find_library(ATOMIC atomic) + list(APPEND EXTRA_LIBRARIES ${ATOMIC}) endif() include(version.cmake) |