Skip to content

Commit e07fd00

Browse files
committed
cmake: only link the graphical client with OpenMP
1 parent cea7f9d commit e07fd00

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-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: 9 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
@@ -221,6 +224,7 @@ endif()
221224

222225
# Tests runnable for any engine variant
223226
set(ENGINETESTLIST ${COMMONTESTLIST}
227+
${OMPLIST}
224228
${ENGINE_DIR}/framework/CommandSystemTest.cpp
225229
)
226230

@@ -273,6 +277,7 @@ set(CLIENTBASELIST
273277
)
274278

275279
set(CLIENTLIST
280+
${OMPLIST}
276281
${ENGINE_DIR}/audio/ALObjects.cpp
277282
${ENGINE_DIR}/audio/ALObjects.h
278283
${ENGINE_DIR}/audio/Audio.cpp
@@ -306,13 +311,15 @@ set(CLIENTTESTLIST ${ENGINETESTLIST}
306311
)
307312

308313
set(TTYCLIENTLIST
314+
${OMPLIST}
309315
${ENGINE_DIR}/null/NullAudio.cpp
310316
${ENGINE_DIR}/null/NullKeyboard.cpp
311317
${ENGINE_DIR}/null/null_input.cpp
312318
${ENGINE_DIR}/null/null_renderer.cpp
313319
)
314320

315321
set(DEDSERVERLIST
322+
${OMPLIST}
316323
${ENGINE_DIR}/null/NullKeyboard.cpp
317324
${ENGINE_DIR}/null/null_client.cpp
318325
${ENGINE_DIR}/null/null_input.cpp

0 commit comments

Comments
 (0)