Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit 85c1515

Browse files
authored
Merge pull request #1733 from scribam/cmake-openmp
cmake: Rework OpenMP integration
2 parents d6db5a5 + 88084ea commit 85c1515

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,13 @@ if(${HOST_OS} EQUAL ${OS_LINUX})
291291
message(FATAL_ERROR "EGL or GLX required")
292292
endif()
293293

294+
find_package(OpenMP)
295+
if(OpenMP_FOUND)
296+
target_link_libraries(${TNAME} OpenMP::OpenMP_CXX)
297+
else()
298+
target_compile_definitions(${TNAME} PUBLIC TARGET_NO_OPENMP)
299+
endif()
300+
294301
find_package(PkgConfig)
295302
if(PKG_CONFIG_FOUND)
296303
pkg_check_modules(AO ao)

reicast/cmake/config.cmake

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,6 @@ elseif ((${BUILD_COMPILER} EQUAL ${COMPILER_GCC}) OR
290290

291291
if((${HOST_CPU} EQUAL ${CPU_X86}) OR (${HOST_CPU} EQUAL ${CPU_X64}))
292292
set(_C_FLAGS "${_C_FLAGS} -msse4")
293-
294-
if(NOT CMAKE_HOST_APPLE)
295-
set(_C_FLAGS "${_C_FLAGS} -fopenmp")
296-
endif()
297293
endif() # X86 family
298294

299295

0 commit comments

Comments
 (0)