diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d367b2e1..28130e566 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,7 +69,11 @@ else() else() set(DEBUG_FLAGS "-g3 -O0") endif() - set(RELEASE_FLAGS "-Ofast -DNDEBUG -Wno-unused-variable -flto") + set(RELEASE_FLAGS "-Ofast -DNDEBUG -Wno-unused-variable") + if(NOT APPLE) + # There is a clang bug that does not allow to compile code that uses AES-NI intrinsics if -flto is enabled + set(RELEASE_FLAGS "${RELEASE_FLAGS} -flto") + endif() #if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT MINGW) # set(RELEASE_FLAGS "${RELEASE_FLAGS} -fno-fat-lto-objects") #endif() @@ -77,8 +81,8 @@ else() set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEBUG_FLAGS}") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${RELEASE_FLAGS}") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${RELEASE_FLAGS}") - if(STATIC) - set_static_flags() + if(STATIC AND NOT APPLE) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++") endif() endif() @@ -86,7 +90,7 @@ if(STATIC) set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_STATIC_RUNTIME ON) endif() -find_package(Boost 1.53 REQUIRED COMPONENTS system filesystem thread date_time chrono regex serialization atomic program_options) +find_package(Boost 1.53 REQUIRED COMPONENTS system filesystem thread date_time chrono regex serialization program_options) if((${Boost_MAJOR_VERSION} EQUAL 1) AND (${Boost_MINOR_VERSION} EQUAL 54)) message(SEND_ERROR "Boost version 1.54 is unsupported, more details are available here http://goo.gl/RrCFmA") endif() |