CMake checks for "UNIX"

instead of having to enumerate all possibilities in if conditionals.
This commit is contained in:
CharlesThobe 2022-01-06 03:54:39 +02:00
parent b145a48c33
commit afde6771c3
3 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@ endif()
set(CMAKE_CXX_STANDARD 17) #needed by libocore and libutils. - set(CMAKE_CXX_STANDARD 17) #needed by libocore and libutils. -
#set globally to match MAME's genie scripts. #set globally to match MAME's genie scripts.
if(CMAKE_SYSTEM_NAME STREQUAL "Windows") if(WIN32)
add_compile_definitions( add_compile_definitions(
X64_WINDOWS_ABI X64_WINDOWS_ABI
CRLF=3 CRLF=3

View File

@ -38,7 +38,7 @@ add_compile_definitions(
) )
endif() endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android") if(UNIX)
add_compile_definitions( add_compile_definitions(
HAVE_DLFCN_H HAVE_DLFCN_H
HAVE_FCNTL_H HAVE_FCNTL_H

View File

@ -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 ${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 target_sources(ocore_sdl PRIVATE
${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixdir.cpp ${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixdir.cpp
${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixfile.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/posixptty.cpp
${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixsocket.cpp ${CMAKE_SOURCE_DIR}/src/osd/modules/file/posixsocket.cpp
) )
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows") elseif(WIN32)
target_sources(ocore_sdl PRIVATE target_sources(ocore_sdl PRIVATE
${CMAKE_SOURCE_DIR}/src/osd/modules/file/windir.cpp ${CMAKE_SOURCE_DIR}/src/osd/modules/file/windir.cpp
${CMAKE_SOURCE_DIR}/src/osd/modules/file/winfile.cpp ${CMAKE_SOURCE_DIR}/src/osd/modules/file/winfile.cpp