diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 346b2592e..84e52d41a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -436,11 +436,7 @@ add_definition_if_function_found(strptime HAVE_STRPTIME) add_definitions(-DAUTO_INITIALIZE_EASYLOGGINGPP) # Generate header for embedded translations -include(ExternalProject) -ExternalProject_Add(generate_translations_header - SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/translations" - BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/translations" - INSTALL_COMMAND cmake -E echo "") +add_subdirectory(translations) include_directories("${CMAKE_CURRENT_BINARY_DIR}/translations") add_subdirectory(external) @@ -567,10 +563,20 @@ else() add_cxx_flag_if_supported(-Wformat-security CXX_SECURITY_FLAGS) # -fstack-protector - add_c_flag_if_supported(-fstack-protector C_SECURITY_FLAGS) - add_cxx_flag_if_supported(-fstack-protector CXX_SECURITY_FLAGS) - add_c_flag_if_supported(-fstack-protector-strong C_SECURITY_FLAGS) - add_cxx_flag_if_supported(-fstack-protector-strong CXX_SECURITY_FLAGS) + if (NOT WIN32) + add_c_flag_if_supported(-fstack-protector C_SECURITY_FLAGS) + add_cxx_flag_if_supported(-fstack-protector CXX_SECURITY_FLAGS) + add_c_flag_if_supported(-fstack-protector-strong C_SECURITY_FLAGS) + add_cxx_flag_if_supported(-fstack-protector-strong CXX_SECURITY_FLAGS) + endif() + + # New in GCC 8.2 + if (NOT WIN32) + add_c_flag_if_supported(-fcf-protection=full C_SECURITY_FLAGS) + add_cxx_flag_if_supported(-fcf-protection=full CXX_SECURITY_FLAGS) + add_c_flag_if_supported(-fstack-clash-protection C_SECURITY_FLAGS) + add_cxx_flag_if_supported(-fstack-clash-protection CXX_SECURITY_FLAGS) + endif() add_c_flag_if_supported(-mmitigate-rop C_SECURITY_FLAGS) add_cxx_flag_if_supported(-mmitigate-rop CXX_SECURITY_FLAGS) @@ -817,7 +823,7 @@ endif() include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) if(MINGW) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wa,-mbig-obj") - set(EXTRA_LIBRARIES mswsock;ws2_32;iphlpapi) + set(EXTRA_LIBRARIES mswsock;ws2_32;iphlpapi;crypt32) set(ICU_LIBRARIES ${Boost_LOCALE_LIBRARY} icuio icuin icuuc icudt icutu iconv) elseif(APPLE OR OPENBSD OR ANDROID) set(EXTRA_LIBRARIES "") @@ -850,6 +856,7 @@ endif() if(ANDROID) set(ATOMIC libatomic.a) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=user-defined-warnings") endif() if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND ARCH_WIDTH EQUAL "32" AND NOT IOS AND NOT FREEBSD) find_library(ATOMIC atomic) |