mirror of
https://github.com/Z3Prover/z3
synced 2025-04-07 09:55:19 +00:00
Only pass OpenMP flags to the linker when using GCC or Clang.
Passing those flags to the linker when MSVC results in a warning about an unused flag.
This commit is contained in:
parent
346f66d656
commit
2b9bdf3947
|
@ -212,10 +212,18 @@ if (USE_OPENMP)
|
||||||
endif()
|
endif()
|
||||||
if (OPENMP_FOUND)
|
if (OPENMP_FOUND)
|
||||||
list(APPEND Z3_COMPONENT_CXX_FLAGS ${OpenMP_CXX_FLAGS})
|
list(APPEND Z3_COMPONENT_CXX_FLAGS ${OpenMP_CXX_FLAGS})
|
||||||
# Targets linking against libz3 (or its individual components)
|
# GCC and Clang need to have additional flags passed to the linker.
|
||||||
# will need to add these flags
|
# We can't do ``target_link_libraries(libz3 INTERFACE ${OpenMP_CXX_FLAGS})``
|
||||||
list(APPEND Z3_DEPENDENT_EXTRA_CXX_LINK_FLAGS ${OpenMP_CXX_FLAGS})
|
# because ``/openmp`` is interpreted as file name rather than a linker
|
||||||
list(APPEND Z3_DEPENDENT_EXTRA_C_LINK_FLAGS ${OpenMP_C_FLAGS})
|
# flag by MSVC and breaks the build
|
||||||
|
if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") OR
|
||||||
|
("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"))
|
||||||
|
list(APPEND Z3_DEPENDENT_EXTRA_CXX_LINK_FLAGS ${OpenMP_C_FLAGS})
|
||||||
|
endif()
|
||||||
|
if (("${CMAKE_C_COMPILER_ID}" MATCHES "Clang") OR
|
||||||
|
("${CMAKE_C_COMPILER_ID}" MATCHES "GNU"))
|
||||||
|
list(APPEND Z3_DEPENDENT_EXTRA_C_LINK_FLAGS ${OpenMP_CXX_FLAGS})
|
||||||
|
endif()
|
||||||
unset(CMAKE_REQUIRED_FLAGS)
|
unset(CMAKE_REQUIRED_FLAGS)
|
||||||
message(STATUS "Using OpenMP")
|
message(STATUS "Using OpenMP")
|
||||||
else()
|
else()
|
||||||
|
|
Loading…
Reference in a new issue