@@ -90,11 +90,11 @@ if(NOT DAEMON_EXTERNAL_APP)
9090
9191 set (NACL_RUNTIME_PATH "" CACHE STRING "Directory containing the NaCl binaries" )
9292
93- if (WIN32 )
93+ if (DAEMON_TARGET_SYSTEM_Windows )
9494 # The alternative code is based on non-curses unix terminal functions.
9595 set (USE_CURSES ON )
9696 else ()
97- if (NOT APPLE )
97+ if (NOT DAEMON_TARGET_SYSTEM_macOS )
9898 # Not supported on macOS because the included version is too old.
9999 option (USE_CURSES_NCURSES "Use ncurses instead of PDCursesMod" ON )
100100 endif ()
@@ -199,7 +199,7 @@ endmacro()
199199
200200set (DEFAULT_USE_EXTERNAL_DEPS_LIBS ON )
201201
202- if (USE_EXTERNAL_DEPS AND NOT NACL )
202+ if (USE_EXTERNAL_DEPS AND NOT DAEMON_TARGET_SYSTEM_NaCl )
203203 set (EXTERNAL_DEPS_DIR "${CMAKE_CURRENT_SOURCE_DIR} /external_deps" CACHE STRING "Directory in which to store the downloaded dependencies." )
204204
205205 set (DEPS_EXT ".tar.xz" )
@@ -214,10 +214,10 @@ if (USE_EXTERNAL_DEPS AND NOT NACL)
214214 set (DEPS_COMPILER default)
215215 endif ()
216216
217- if (WIN32 )
217+ if (DAEMON_TARGET_SYSTEM_Windows )
218218 set (DEPS_SYSTEM windows)
219219 set (SUPPORTED_${DEPS_SYSTEM} _ARCH amd64 i686)
220- elseif (APPLE )
220+ elseif (DAEMON_TARGET_SYSTEM_macOS )
221221 set (DEPS_SYSTEM macos)
222222 set (SUPPORTED_${DEPS_SYSTEM} _ARCH amd64)
223223
@@ -230,10 +230,10 @@ if (USE_EXTERNAL_DEPS AND NOT NACL)
230230 set (DEFAULT_USE_EXTERNAL_DEPS_LIBS OFF )
231231 endif ()
232232 endif ()
233- elseif (LINUX )
233+ elseif (DAEMON_TARGET_SYSTEM_Linux )
234234 set (DEPS_SYSTEM linux )
235235 set (SUPPORTED_${DEPS_SYSTEM} _ARCH amd64 i686 arm64 armhf)
236- elseif (FREEBSD )
236+ elseif (DAEMON_TARGET_SYSTEM_FreeBSD )
237237 set (DEPS_SYSTEM freebsd)
238238 set (SUPPORTED_${DEPS_SYSTEM} _ARCH amd64 i686)
239239
@@ -264,7 +264,7 @@ endif()
264264
265265option (USE_EXTERNAL_DEPS_LIBS "Build and link against libraries from the EXTERNAL_DEPS_DIR" ${DEFAULT_USE_EXTERNAL_DEPS_LIBS} )
266266
267- if (USE_EXTERNAL_DEPS AND NOT NACL )
267+ if (USE_EXTERNAL_DEPS AND NOT DAEMON_TARGET_SYSTEM_NaCl )
268268 if (DEPS_DIR)
269269 message (STATUS "Using external deps dir: ${DEPS_DIR} " )
270270
@@ -462,23 +462,23 @@ endif()
462462
463463# Native client
464464include (DaemonNacl )
465- if (NACL )
465+ if (DAEMON_TARGET_SYSTEM_NaCl )
466466 add_library (srclibs-nacl-module EXCLUDE_FROM_ALL ${NACLLIST_MODULE} )
467467 set (LIBS_BASE ${LIBS_BASE} srclibs-nacl-module)
468468else ()
469469 add_library (srclibs-nacl-native EXCLUDE_FROM_ALL ${NACLLIST_NATIVE} )
470470 set_target_properties (srclibs-nacl-native PROPERTIES POSITION_INDEPENDENT_CODE 1 FOLDER "libs" )
471- if (APPLE )
471+ if (DAEMON_TARGET_SYSTEM_macOS )
472472 # Do not error for OSAtomic* deprecation notices
473473 target_compile_options (srclibs-nacl-native PRIVATE "-Wno-error=deprecated-declarations" )
474474 endif ()
475475 set (LIBS_BASE ${LIBS_BASE} srclibs-nacl-native)
476476endif ()
477477
478478# Base OS libs
479- if (WIN32 )
479+ if (DAEMON_TARGET_SYSTEM_Windows )
480480 set (LIBS_BASE ${LIBS_BASE} winmm ws2_32)
481- elseif (NACL )
481+ elseif (DAEMON_TARGET_SYSTEM_NaCl )
482482 find_library (NACL_EXCEPTION nacl_exception )
483483 find_library (NACL_MINIDUMP minidump_generator )
484484
@@ -510,7 +510,7 @@ else()
510510 set (LIBS_BASE ${LIBS_BASE} ${CMAKE_DL_LIBS} )
511511 find_package (Threads REQUIRED )
512512 set (LIBS_BASE ${LIBS_BASE} ${CMAKE_THREAD_LIBS_INIT} )
513- if (APPLE )
513+ if (DAEMON_TARGET_SYSTEM_macOS )
514514 set (LIBS_CLIENT ${LIBS_CLIENT} "-framework Carbon" "-framework IOKit" "-framework Cocoa" )
515515 endif ()
516516endif ()
@@ -533,7 +533,7 @@ else()
533533
534534 # Look for OpenGL here before we potentially switch to looking for static libs.
535535 if (BUILD_CLIENT)
536- if (LINUX OR FREEBSD )
536+ if (DAEMON_TARGET_SYSTEM_Linux OR DAEMON_TARGET_SYSTEM_FreeBSD )
537537 # Set LEGACY OpenGL ABI if the variable is not explictly set.
538538 # The backward-incompatible GLVND OpenGL ABI should only be used
539539 # by developers who have a good reason to require it.
@@ -549,7 +549,7 @@ else()
549549 # This code is unreachable since it already errored out at find_package time.
550550 # This code only executes if OpenGL is supported, either because the GLVND ABI
551551 # is available, either because the LEGACY ABI is available.
552- if (LINUX OR FREEBSD )
552+ if (DAEMON_TARGET_SYSTEM_Linux OR DAEMON_TARGET_SYSTEM_FreeBSD )
553553 if (NOT OPENGL_gl_LIBRARY)
554554 # When OpenGL_GL_PREFERENCE is supported and GLVND is available
555555 # OPENGL_gl_LIBRARY is expected to be empty. So we can use the
@@ -596,7 +596,7 @@ endif()
596596
597597# Prefer static libs
598598if ( USE_STATIC_LIBS )
599- if (LINUX OR FREEBSD )
599+ if (DAEMON_TARGET_SYSTEM_Linux OR DAEMON_TARGET_SYSTEM_FreeBSD )
600600 set (CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES} )
601601 endif ()
602602endif ()
@@ -624,7 +624,7 @@ if (BUILD_CLIENT OR BUILD_TTY_CLIENT OR BUILD_SERVER OR BUILD_DUMMY_APP)
624624 set (LIBS_ENGINE_BASE ${LIBS_ENGINE_BASE} ${CURSESW_LIBRARIES} )
625625 include_directories (${CURSESW_INCLUDE_DIR} )
626626 else ()
627- if (WIN32 )
627+ if (DAEMON_TARGET_SYSTEM_Windows )
628628 set (LIBS_ENGINE_BASE ${LIBS_ENGINE_BASE} gdi32 comdlg32)
629629 endif ()
630630
@@ -674,7 +674,7 @@ if (BUILD_CLIENT OR BUILD_TTY_CLIENT)
674674endif ()
675675
676676# SDL, required for all targets on win32 because of iconv and SDL_SetHint(SDL_TIMER_RESOLUTION, 0)
677- if (BUILD_CLIENT OR WIN32 )
677+ if (BUILD_CLIENT OR DAEMON_TARGET_SYSTEM_Windows )
678678 # Use our detected architecture instead of letting SDL do it again
679679 # Note that sdlcpu.cmake is only included on a random subset of platforms
680680 set (sdlvar_i686 SDL_CPU_X86)
@@ -689,7 +689,7 @@ if (BUILD_CLIENT OR WIN32)
689689
690690 find_package (SDL3 REQUIRED CONFIG )
691691
692- if (WIN32 )
692+ if (DAEMON_TARGET_SYSTEM_Windows )
693693 set (LIBS_ENGINE_BASE ${LIBS_ENGINE_BASE} SDL3::SDL3)
694694 else ()
695695 set (LIBS_CLIENT ${LIBS_CLIENT} SDL3::SDL3)
@@ -701,7 +701,7 @@ if (USE_BREAKPAD)
701701 add_definitions (-DUSE_BREAKPAD )
702702 include_directories (${LIB_DIR} /breakpad/src )
703703
704- if (WIN32 )
704+ if (DAEMON_TARGET_SYSTEM_Windows )
705705 add_library (srclibs-breakpad-common EXCLUDE_FROM_ALL ${BREAKPAD_COMMON_LIST} )
706706 add_library (srclibs-breakpad-crash_generation_server EXCLUDE_FROM_ALL ${BREAKPAD_CRASHGENERATIONSERVER_LIST} )
707707 add_library (srclibs-breakpad-exception_handler EXCLUDE_FROM_ALL ${BREAKPAD_EXCEPTIONHANDLER_LIST} )
@@ -731,7 +731,7 @@ if (USE_BREAKPAD)
731731 set (LIBS_ENGINE_BASE ${LIBS_ENGINE_BASE} srclibs-breakpad-exception_handler
732732 srclibs-breakpad-crash_generation_client srclibs-breakpad-common)
733733
734- elseif (LINUX )
734+ elseif (DAEMON_TARGET_SYSTEM_Linux )
735735 add_library (srclibs-breakpad EXCLUDE_FROM_ALL ${BREAKPAD_LIST} )
736736 set_target_properties (srclibs-breakpad PROPERTIES POSITION_INDEPENDENT_CODE 1 FOLDER "libs" )
737737 target_compile_definitions (srclibs-breakpad PUBLIC HAVE_GETCONTEXT=1 )
@@ -746,7 +746,7 @@ option(PREFER_EXTERNAL_LIBS "Tries to use system libs where possible." ON)
746746
747747macro (prefer_package LIB_NAME LIB_CMAKE )
748748 if (NOT ${LIB_NAME} _FOUND)
749- if (PREFER_EXTERNAL_LIBS AND NOT NACL )
749+ if (PREFER_EXTERNAL_LIBS AND NOT DAEMON_TARGET_SYSTEM_NaCl )
750750 find_package (${LIB_NAME} )
751751
752752 if (NOT ${LIB_NAME} _FOUND)
@@ -876,7 +876,7 @@ endfunction()
876876
877877daemon_write_buildinfo ("Engine" )
878878
879- if (NOT NACL )
879+ if (NOT DAEMON_TARGET_SYSTEM_NaCl )
880880 add_library (engine-lib EXCLUDE_FROM_ALL ${PCH_FILE} ${BUILDINFOLIST} ${COMMONLIST} ${ENGINELIST} )
881881 target_link_libraries (engine-lib ${LIBS_BASE} ${LIBS_ENGINE_BASE} ${CPP23SupportLibrary} )
882882 set_property (TARGET engine-lib APPEND PROPERTY COMPILE_DEFINITIONS BUILD_ENGINE )
@@ -979,7 +979,7 @@ if (DEPS_DIR AND HAS_NACL AND (BUILD_CLIENT OR BUILD_TTY_CLIENT OR BUILD_SERVER
979979 )
980980
981981 # Linux uses a bootstrap program to reserve address space
982- if (LINUX OR FREEBSD )
982+ if (DAEMON_TARGET_SYSTEM_Linux OR DAEMON_TARGET_SYSTEM_FreeBSD )
983983 if (DAEMON_ARCH_arm64)
984984 add_executable (nacl_helper_bootstrap-armhf tools/nacl_helper_bootstrap-armhf/nacl_helper_bootstrap-armhf.cpp )
985985 add_dependencies (runtime_deps nacl_helper_bootstrap-armhf )
@@ -1004,7 +1004,7 @@ if (DEPS_DIR AND HAS_NACL AND (BUILD_CLIENT OR BUILD_TTY_CLIENT OR BUILD_SERVER
10041004 endif ()
10051005
10061006 # Win32 requires nacl_loader_amd64.exe in order to run on Win64
1007- if (WIN32 AND DAEMON_ARCH_i686)
1007+ if (DAEMON_TARGET_SYSTEM_Windows AND DAEMON_ARCH_i686)
10081008 add_custom_command (TARGET runtime_deps PRE_BUILD
10091009 COMMAND ${CMAKE_COMMAND} -E copy_if_different
10101010 ${DEPS_DIR} /nacl_loader-amd64${CMAKE_EXECUTABLE_SUFFIX}
@@ -1018,7 +1018,7 @@ if (DEPS_DIR AND HAS_NACL AND (BUILD_CLIENT OR BUILD_TTY_CLIENT OR BUILD_SERVER
10181018 endif ()
10191019
10201020 # Mac requires some libraries from external_deps
1021- if (APPLE )
1021+ if (DAEMON_TARGET_SYSTEM_macOS )
10221022 file (GLOB RUNTIME_FRAMEWORKS ${DEPS_DIR} /lib/*.framework )
10231023 foreach (RUNTIME_FRAMEWORK ${RUNTIME_FRAMEWORKS} )
10241024 get_filename_component (RUNTIME_FRAMEWORK_NAME ${RUNTIME_FRAMEWORK} NAME )
@@ -1040,7 +1040,7 @@ if (DEPS_DIR AND HAS_NACL AND (BUILD_CLIENT OR BUILD_TTY_CLIENT OR BUILD_SERVER
10401040 endif ()
10411041
10421042 # Windows requires some libraries from external_deps
1043- if (WIN32 )
1043+ if (DAEMON_TARGET_SYSTEM_Windows )
10441044 file (GLOB RUNTIME_LIBS ${DEPS_DIR} /bin/*.dll ${DEPS_DIR} /SDL3/lib/*/SDL3.dll )
10451045 foreach (RUNTIME_LIB ${RUNTIME_LIBS} )
10461046 add_custom_command (TARGET runtime_deps PRE_BUILD
0 commit comments