Skip to content

Commit 34044f6

Browse files
committed
cmake: only link the graphical client with OpenMP
1 parent 09bcd50 commit 34044f6

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,8 @@ if (BUILD_CLIENT)
922922
ExecutableName ${CLIENT_EXECUTABLE_NAME}
923923
ApplicationMain ${ENGINE_DIR}/client/ClientApplication.cpp
924924
Definitions ${Definitions}
925-
CompileFlags ${WARNINGS}
925+
CompileFlags ${WARNINGS};${OPENMP_FLAG}
926+
LinkFlags ${OPENMP_FLAG}
926927
Files ${WIN_RC} ${BUILDINFOLIST} ${QCOMMONLIST} ${SERVERLIST} ${CLIENTBASELIST} ${CLIENTLIST}
927928
Libs ${LIBS_CLIENT} ${LIBS_CLIENTBASE} ${LIBS_ENGINE}
928929
Tests ${CLIENTTESTLIST}

cmake/DaemonFlags.cmake

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,11 @@ if (MSVC)
272272
endif()
273273

274274
if (NOT NACL AND BUILD_CLIENT AND USE_OPENMP)
275-
try_cxx_flag(OPENMP "/openmp")
275+
check_CXX_compiler_flag("/openmp" FLAG_OPENMP)
276276

277-
if (NOT FLAG_OPENMP)
277+
if (FLAG_OPENMP)
278+
set(OPENMP_FLAG "/openmp")
279+
else()
278280
message(WARNING "Missing OpenMP")
279281
endif()
280282
endif()
@@ -375,9 +377,11 @@ else()
375377
endif()
376378

377379
if (NOT NACL AND BUILD_CLIENT AND USE_OPENMP)
378-
try_cxx_flag(FOPENMP "-fopenmp")
380+
check_CXX_compiler_flag("-fopenmp" FLAG_FOPENMP)
379381

380-
if (NOT FLAG_FOPENMP)
382+
if (FLAG_FOPENMP)
383+
set(OPENMP_FLAG "-fopenmp")
384+
else()
381385
message(WARNING "Missing OpenMP")
382386
endif()
383387
endif()

src.cmake

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ set(ENGINELIST
188188
${ENGINE_DIR}/framework/CvarSystem.h
189189
${ENGINE_DIR}/framework/LogSystem.cpp
190190
${ENGINE_DIR}/framework/LogSystem.h
191-
${ENGINE_DIR}/framework/OmpSystem.cpp
192-
${ENGINE_DIR}/framework/OmpSystem.h
193191
${ENGINE_DIR}/framework/Resource.cpp
194192
${ENGINE_DIR}/framework/Resource.h
195193
${ENGINE_DIR}/framework/System.cpp
@@ -209,6 +207,11 @@ set(ENGINELIST
209207
${ENGINE_DIR}/RefAPI.h
210208
)
211209

210+
set(OMPLIST
211+
${ENGINE_DIR}/framework/OmpSystem.cpp
212+
${ENGINE_DIR}/framework/OmpSystem.h
213+
)
214+
212215
if (WIN32)
213216
set(ENGINELIST ${ENGINELIST}
214217
${ENGINE_DIR}/sys/con_passive.cpp
@@ -273,6 +276,7 @@ set(CLIENTBASELIST
273276
)
274277

275278
set(CLIENTLIST
279+
${OMPLIST}
276280
${ENGINE_DIR}/audio/ALObjects.cpp
277281
${ENGINE_DIR}/audio/ALObjects.h
278282
${ENGINE_DIR}/audio/Audio.cpp
@@ -306,13 +310,15 @@ set(CLIENTTESTLIST ${ENGINETESTLIST}
306310
)
307311

308312
set(TTYCLIENTLIST
313+
${OMPLIST}
309314
${ENGINE_DIR}/null/NullAudio.cpp
310315
${ENGINE_DIR}/null/NullKeyboard.cpp
311316
${ENGINE_DIR}/null/null_input.cpp
312317
${ENGINE_DIR}/null/null_renderer.cpp
313318
)
314319

315320
set(DEDSERVERLIST
321+
${OMPLIST}
316322
${ENGINE_DIR}/null/NullKeyboard.cpp
317323
${ENGINE_DIR}/null/null_client.cpp
318324
${ENGINE_DIR}/null/null_input.cpp

0 commit comments

Comments
 (0)