summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorAdrian Graber <adrian@adriangraber.com>2021-07-04 18:52:48 +0200
committerAdrian Graber <adrian@adriangraber.com>2021-07-13 00:49:13 +0200
commit28f266302fbeea2d75d5a62de651d464ab380798 (patch)
treee9ae6bc810489c798e6bb3f27d75afe803c7f9ae /src/CMakeLists.txt
parentVanilla config for Windows and win-x86 only (diff)
downloadre3-28f266302fbeea2d75d5a62de651d464ab380798.tar
re3-28f266302fbeea2d75d5a62de651d464ab380798.tar.gz
re3-28f266302fbeea2d75d5a62de651d464ab380798.tar.bz2
re3-28f266302fbeea2d75d5a62de651d464ab380798.tar.lz
re3-28f266302fbeea2d75d5a62de651d464ab380798.tar.xz
re3-28f266302fbeea2d75d5a62de651d464ab380798.tar.zst
re3-28f266302fbeea2d75d5a62de651d464ab380798.zip
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt40
1 files changed, 38 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 28090d7e..67dfb325 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -120,13 +120,19 @@ 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()
+
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 +146,33 @@ if(${PROJECT}_INSTALL)
install(FILES $<TARGET_PDB_FILE:${EXECUTABLE}> DESTINATION "." OPTIONAL)
endif()
endif()
+
+# Build Nintendo Switch binaries
+if(NINTENDO_SWITCH)
+ target_compile_definitions(${EXECUTABLE} PRIVATE
+ GTA_SWITCH
+ )
+
+ # Needed for OpenAL-Soft
+ target_link_libraries(${EXECUTABLE} PRIVATE
+ openal # HACK - something broke with latest cmake
+ SDL2
+ )
+
+ nx_generate_nacp (${EXECUTABLE}.nacp
+ NAME "${EXECUTABLE}"
+ AUTHOR "${EXECUTABLE} Team"
+ VERSION "1.0.0-${GIT_SHA1}"
+ )
+
+ nx_create_nro(${EXECUTABLE}
+ NACP ${EXECUTABLE}.nacp
+ ICON "${PROJECT_SOURCE_DIR}/logo_switch.jpg"
+ )
+
+ if(${PROJECT}_INSTALL)
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE}.nro"
+ DESTINATION "."
+ )
+ endif()
+endif()