Enable use of OpenMP simd pragmas
This commit is contained in:
parent
b682fa28e4
commit
2473c57cc6
2 changed files with 19 additions and 0 deletions
|
|
@ -1,6 +1,16 @@
|
|||
# Find system threads
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
# Find OpenMP
|
||||
find_package(OpenMP)
|
||||
if(OPENMP_FOUND)
|
||||
add_library(sfizz_openmp INTERFACE)
|
||||
add_library(sfizz::openmp ALIAS sfizz_openmp)
|
||||
target_compile_options(sfizz_openmp INTERFACE
|
||||
$<$<COMPILE_LANGUAGE:C>:${OpenMP_C_FLAGS}>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:${OpenMP_CXX_FLAGS}>)
|
||||
endif()
|
||||
|
||||
# Find macOS system libraries
|
||||
if(APPLE)
|
||||
find_library(APPLE_COREFOUNDATION_LIBRARY "CoreFoundation")
|
||||
|
|
@ -71,6 +81,9 @@ add_subdirectory("external/st_audiofile" EXCLUDE_FROM_ALL)
|
|||
add_library(sfizz_simde INTERFACE)
|
||||
add_library(sfizz::simde ALIAS sfizz_simde)
|
||||
target_include_directories(sfizz_simde INTERFACE "external/simde")
|
||||
if(TARGET sfizz::openmp)
|
||||
target_link_libraries(sfizz_simde INTERFACE sfizz::openmp)
|
||||
endif()
|
||||
|
||||
# The pugixml library
|
||||
add_library(sfizz_pugixml STATIC "src/external/pugixml/src/pugixml.cpp")
|
||||
|
|
|
|||
|
|
@ -364,3 +364,9 @@ SFIZZ_C_FLAGS += -pthread
|
|||
SFIZZ_CXX_FLAGS += -pthread
|
||||
SFIZZ_LINK_FLAGS += -pthread
|
||||
endif
|
||||
|
||||
### OpenMP dependency
|
||||
|
||||
SFIZZ_C_FLAGS += -fopenmp
|
||||
SFIZZ_CXX_FLAGS += -fopenmp
|
||||
SFIZZ_LINK_FLAGS += -fopenmp
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue