summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/CMakeLists.txt')
-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)