summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorAdrian Graber <adrian@adriangraber.com>2021-07-13 01:11:42 +0200
committerAdrian Graber <adrian@adriangraber.com>2021-07-13 01:18:49 +0200
commit6665b16ba279f9d92c5a5b2ddc62dd584e20b581 (patch)
tree1afbad268cc33b440c406ffa254304b3f819147c /src/CMakeLists.txt
parentdisable USE_CUTSCENE_SHADOW_FOR_PED if COMPATIBLE_SAVES isn't defined (diff)
downloadre3-6665b16ba279f9d92c5a5b2ddc62dd584e20b581.tar
re3-6665b16ba279f9d92c5a5b2ddc62dd584e20b581.tar.gz
re3-6665b16ba279f9d92c5a5b2ddc62dd584e20b581.tar.bz2
re3-6665b16ba279f9d92c5a5b2ddc62dd584e20b581.tar.lz
re3-6665b16ba279f9d92c5a5b2ddc62dd584e20b581.tar.xz
re3-6665b16ba279f9d92c5a5b2ddc62dd584e20b581.tar.zst
re3-6665b16ba279f9d92c5a5b2ddc62dd584e20b581.zip
Diffstat (limited to '')
-rw-r--r--src/CMakeLists.txt27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 28090d7e..30284769 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -54,9 +54,13 @@ target_compile_definitions(${EXECUTABLE} PRIVATE USE_OUR_VERSIONING)
if(${PROJECT}_AUDIO STREQUAL "OAL")
find_package(OpenAL REQUIRED)
- target_include_directories(${EXECUTABLE} PRIVATE ${OPENAL_INCLUDE_DIR})
- target_link_libraries(${EXECUTABLE} PRIVATE ${OPENAL_LIBRARY})
- target_compile_definitions(${EXECUTABLE} PRIVATE ${OPENAL_DEFINITIONS})
+ if(TARGET OpenAL::OpenAL)
+ target_link_libraries(${EXECUTABLE} PRIVATE OpenAL::OpenAL)
+ else()
+ target_include_directories(${EXECUTABLE} PRIVATE ${OPENAL_INCLUDE_DIR})
+ target_link_libraries(${EXECUTABLE} PRIVATE ${OPENAL_LIBRARY})
+ target_compile_definitions(${EXECUTABLE} PRIVATE ${OPENAL_DEFINITIONS})
+ endif()
target_compile_definitions(${EXECUTABLE} PRIVATE AUDIO_OAL)
elseif(${PROJECT}_AUDIO STREQUAL "MSS")
find_package(MilesSDK REQUIRED)
@@ -120,13 +124,24 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
)
endif()
+if(NINTENDO_SWITCH)
+ set(${PROJECT}_C_CXX_EXTENSIONS ON)
+else()
+ set(${PROJECT}_C_CXX_EXTENSIONS OFF)
+endif()
+
+if(NOT (WIN32 OR APPLE OR NINTENDO_SWITCH))
+ find_package(X11 REQUIRED)
+ target_link_libraries(${EXECUTABLE} PRIVATE X11::X11)
+endif()
+
set_target_properties(${EXECUTABLE}
PROPERTIES
C_STANDARD 11
- C_EXTENSIONS OFF
+ C_EXTENSIONS ${${PROJECT}_C_CXX_EXTENSIONS}
C_STANDARD_REQUIRED ON
CXX_STANDARD 11
- CXX_EXTENSIONS OFF
+ CXX_EXTENSIONS ${${PROJECT}_C_CXX_EXTENSIONS}
CXX_STANDARD_REQUIRED ON
)
@@ -140,3 +155,5 @@ if(${PROJECT}_INSTALL)
install(FILES $<TARGET_PDB_FILE:${EXECUTABLE}> DESTINATION "." OPTIONAL)
endif()
endif()
+
+reVC_platform_target(${EXECUTABLE} INSTALL)