Only put the openmp flags when it is present
This commit is contained in:
parent
e6e12a26ec
commit
9cc7f8e39e
|
@ -51,10 +51,11 @@ if (${IS_GNU} OR ${IS_CLANG})
|
||||||
if (NOT (MINGW AND ${IS_CLANG})) # llvm-mingw linux packages don't bundle openmp
|
if (NOT (MINGW AND ${IS_CLANG})) # llvm-mingw linux packages don't bundle openmp
|
||||||
include(FindOpenMP)
|
include(FindOpenMP)
|
||||||
if (OpenMP_CXX_FOUND)
|
if (OpenMP_CXX_FOUND)
|
||||||
|
set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
|
||||||
add_definitions(-D_GLIBCXX_PARALLEL)
|
add_definitions(-D_GLIBCXX_PARALLEL)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
set(CMAKE_CXX_FLAGS "-flto ${OpenMP_CXX_FLAGS} ${CMAKE_CXX_FLAGS} -pipe -fstack-protector-strong -fstack-clash-protection -funwind-tables -fasynchronous-unwind-tables -fexceptions")
|
set(CMAKE_CXX_FLAGS "-flto ${CMAKE_CXX_FLAGS} -pipe -fstack-protector-strong -fstack-clash-protection -funwind-tables -fasynchronous-unwind-tables -fexceptions")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections -fdata-sections -fmerge-all-constants -ftree-vectorize")
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections -fdata-sections -fmerge-all-constants -ftree-vectorize")
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
set(CF_PROTECTION "-fcf-protection")
|
set(CF_PROTECTION "-fcf-protection")
|
||||||
|
|
Loading…
Reference in New Issue