From afde6771c3f6de341b470fe2f2a1fad84401180e Mon Sep 17 00:00:00 2001 From: CharlesThobe Date: Thu, 6 Jan 2022 03:54:39 +0200 Subject: [PATCH] CMake checks for "UNIX" instead of having to enumerate all possibilities in if conditionals. --- CMakeLists.txt | 2 +- cmake_subdirs/expat/CMakeLists.txt | 2 +- cmake_subdirs/ocore_sdl/CMakeLists.txt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fedc54f..e6411cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ endif() set(CMAKE_CXX_STANDARD 17) #needed by libocore and libutils. - #set globally to match MAME's genie scripts. -if(CMAKE_SYSTEM_NAME STREQUAL "Windows") +if(WIN32) add_compile_definitions( X64_WINDOWS_ABI CRLF=3 diff --git a/cmake_subdirs/expat/CMakeLists.txt b/cmake_subdirs/expat/CMakeLists.txt index 5eb6c27..e72f2d6 100644 --- a/cmake_subdirs/expat/CMakeLists.txt +++ b/cmake_subdirs/expat/CMakeLists.txt @@ -38,7 +38,7 @@ add_compile_definitions( ) endif() -if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android") +if(UNIX) add_compile_definitions( HAVE_DLFCN_H HAVE_FCNTL_H diff --git a/cmake_subdirs/ocore_sdl/CMakeLists.txt b/cmake_subdirs/ocore_sdl/CMakeLists.txt index 47707bf..e2a4052 100644 --- a/cmake_subdirs/ocore_sdl/CMakeLists.txt +++ b/cmake_subdirs/ocore_sdl/CMakeLists.txt @@ -21,7 +21,7 @@ ${CMAKE_SOURCE_DIR}/src/osd/modules/lib/osd_getenv.cpp #instead of osdlib_${targ ${CMAKE_SOURCE_DIR}/src/osd/modules/lib/osdlib.h ) -if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android") +if(UNIX) target_sources(ocore_sdl PRIVATE ${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixdir.cpp ${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixfile.cpp @@ -29,7 +29,7 @@ target_sources(ocore_sdl PRIVATE ${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixptty.cpp ${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixsocket.cpp ) -elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") +elseif(WIN32) target_sources(ocore_sdl PRIVATE ${CMAKE_SOURCE_DIR}/src/osd/modules/file/windir.cpp ${CMAKE_SOURCE_DIR}/src/osd/modules/file/winfile.cpp