2022-08-05 01:59:19 -04:00
|
|
|
cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)
|
|
|
|
|
|
|
|
set(CMAKE_SYSTEM_VERSION 10.0 CACHE STRING "" FORCE)
|
|
|
|
|
2023-02-28 13:19:34 -05:00
|
|
|
project(soh LANGUAGES C CXX)
|
2022-08-05 01:59:19 -04:00
|
|
|
set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
|
|
|
|
|
2023-03-02 03:27:28 -05:00
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
|
|
enable_language(OBJCXX)
|
|
|
|
set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS} -fobjc-arc")
|
|
|
|
set(CMAKE_OBJCXX_FLAGS "${CMAKE_OBJCXX_FLAGS} -fobjc-arc")
|
|
|
|
endif()
|
|
|
|
|
2022-08-05 01:59:19 -04:00
|
|
|
set (BUILD_UTILS OFF CACHE STRING "no utilities")
|
|
|
|
set (BUILD_SHARED_LIBS OFF CACHE STRING "install/link shared instead of static libs")
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Set target arch type if empty. Visual studio solution generator provides it.
|
|
|
|
################################################################################
|
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
|
|
if(NOT CMAKE_VS_PLATFORM_NAME)
|
|
|
|
set(CMAKE_VS_PLATFORM_NAME "x64")
|
|
|
|
endif()
|
|
|
|
message("${CMAKE_VS_PLATFORM_NAME} architecture in use")
|
|
|
|
|
|
|
|
if(NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64"
|
|
|
|
OR "${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32"))
|
|
|
|
message(FATAL_ERROR "${CMAKE_VS_PLATFORM_NAME} arch is not supported!")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Global configuration types
|
|
|
|
################################################################################
|
|
|
|
set(CMAKE_CONFIGURATION_TYPES
|
|
|
|
"Debug"
|
|
|
|
"Release"
|
|
|
|
CACHE STRING "" FORCE
|
|
|
|
)
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Global compiler options
|
|
|
|
################################################################################
|
|
|
|
if(MSVC)
|
|
|
|
# remove default flags provided with CMake for MSVC
|
|
|
|
set(CMAKE_C_FLAGS "")
|
|
|
|
set(CMAKE_C_FLAGS_DEBUG "")
|
|
|
|
set(CMAKE_C_FLAGS_RELEASE "")
|
|
|
|
set(CMAKE_CXX_FLAGS "")
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG "")
|
|
|
|
set(CMAKE_CXX_FLAGS_RELEASE "")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Global linker options
|
|
|
|
################################################################################
|
|
|
|
if(MSVC)
|
|
|
|
# remove default flags provided with CMake for MSVC
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS "")
|
|
|
|
set(CMAKE_MODULE_LINKER_FLAGS "")
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS "")
|
|
|
|
set(CMAKE_STATIC_LINKER_FLAGS "")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS}")
|
|
|
|
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS}")
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS}")
|
|
|
|
set(CMAKE_STATIC_LINKER_FLAGS_DEBUG "${CMAKE_STATIC_LINKER_FLAGS}")
|
|
|
|
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS}")
|
|
|
|
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS}")
|
|
|
|
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS}")
|
|
|
|
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Common utils
|
|
|
|
################################################################################
|
|
|
|
include(CMake/Utils.cmake)
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Additional Global Settings(add specific info there)
|
|
|
|
################################################################################
|
|
|
|
include(CMake/GlobalSettingsInclude.cmake OPTIONAL)
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Use solution folders feature
|
|
|
|
################################################################################
|
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Sub-projects
|
|
|
|
################################################################################
|
|
|
|
if (NOT TARGET libultraship)
|
2022-11-14 05:22:34 -05:00
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../libultraship ${CMAKE_BINARY_DIR}/libultraship)
|
2022-08-05 01:59:19 -04:00
|
|
|
endif()
|
|
|
|
|
2023-04-25 00:01:17 -04:00
|
|
|
if (NOT TARGET ZAPDLib)
|
|
|
|
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../ZAPDTR/ZAPD ${CMAKE_BINARY_DIR}/ZAPD)
|
|
|
|
endif()
|
|
|
|
|
2022-08-05 01:59:19 -04:00
|
|
|
set(PROJECT_NAME soh)
|
|
|
|
|
|
|
|
################################################################################
|
2023-02-28 13:19:34 -05:00
|
|
|
# Sources
|
2022-08-05 01:59:19 -04:00
|
|
|
################################################################################
|
2024-04-20 11:03:41 -04:00
|
|
|
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/src/boot/build.c.in ${CMAKE_CURRENT_SOURCE_DIR}/src/boot/build.c @ONLY)
|
|
|
|
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/properties.h.in ${CMAKE_CURRENT_SOURCE_DIR}/properties.h @ONLY)
|
2022-10-03 19:13:29 -04:00
|
|
|
|
2023-02-28 13:19:34 -05:00
|
|
|
set(Header_Files "resource.h")
|
|
|
|
source_group("headers" FILES ${Header_Files})
|
|
|
|
|
|
|
|
# include {{{
|
|
|
|
file(GLOB Header_Files__include "include/*.h" "include/*.inc")
|
|
|
|
list(APPEND Header_Files__include ${CMAKE_CURRENT_SOURCE_DIR}/include/libc/stdarg.h)
|
|
|
|
list(REMOVE_ITEM Header_Files__include ${CMAKE_CURRENT_SOURCE_DIR}/include/bgm.h)
|
|
|
|
list(REMOVE_ITEM Header_Files__include ${CMAKE_CURRENT_SOURCE_DIR}/include/math_n64.h)
|
|
|
|
list(REMOVE_ITEM Header_Files__include ${CMAKE_CURRENT_SOURCE_DIR}/include/stdbool_n64.h)
|
|
|
|
list(REMOVE_ITEM Header_Files__include ${CMAKE_CURRENT_SOURCE_DIR}/include/stddef_n64.h)
|
|
|
|
list(REMOVE_ITEM Header_Files__include ${CMAKE_CURRENT_SOURCE_DIR}/include/stdlib_n64.h)
|
|
|
|
list(REMOVE_ITEM Header_Files__include ${CMAKE_CURRENT_SOURCE_DIR}/include/ultra64.h)
|
|
|
|
source_group("include" FILES ${Header_Files__include})
|
|
|
|
# }}}
|
|
|
|
|
|
|
|
# soh (root)
|
2024-10-18 12:35:07 -04:00
|
|
|
file(GLOB_RECURSE soh__ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "soh/*.c" "soh/*.cpp" "soh/*.h" "soh/*.hpp")
|
2023-02-28 13:19:34 -05:00
|
|
|
|
2024-10-18 12:35:07 -04:00
|
|
|
# Add specific files that don't match the pattern
|
|
|
|
list(APPEND soh__ ${CMAKE_CURRENT_SOURCE_DIR}/soh/Enhancements/savestates_extern.inc)
|
|
|
|
list(APPEND soh__ ${CMAKE_CURRENT_SOURCE_DIR}/soh/Enhancements/speechsynthesizer/DarwinSpeechSynthesizer.mm)
|
|
|
|
|
|
|
|
# Create source groups that match the real file directory paths
|
|
|
|
foreach(source IN LISTS soh__)
|
|
|
|
get_filename_component(source_path "${source}" PATH)
|
|
|
|
string(REPLACE "/" "\\" source_path_adjusted "${source_path}")
|
|
|
|
source_group("${source_path_adjusted}" FILES "${source}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
# Fix UTF-8 issues for MSVC
|
2023-03-02 03:27:28 -05:00
|
|
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|
|
|
set_source_files_properties(soh/OTRGlobals.cpp PROPERTIES COMPILE_FLAGS "/utf-8")
|
2024-10-18 12:35:07 -04:00
|
|
|
set_source_files_properties(soh/Enhancements/tts/tts.cpp PROPERTIES COMPILE_FLAGS "/utf-8")
|
2023-03-02 03:27:28 -05:00
|
|
|
endif()
|
|
|
|
|
2024-10-18 12:35:07 -04:00
|
|
|
# handle Network removals
|
2023-12-17 14:41:33 -05:00
|
|
|
if (!BUILD_REMOTE_CONTROL)
|
2024-10-18 12:35:07 -04:00
|
|
|
list(FILTER soh__ EXCLUDE REGEX "soh/Enhancements/crowd-control/*")
|
2023-03-02 03:27:28 -05:00
|
|
|
endif()
|
|
|
|
|
|
|
|
# handle speechsynthesizer removals
|
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
2024-10-18 12:35:07 -04:00
|
|
|
list(FILTER soh__ EXCLUDE REGEX "soh/Enhancements/speechsynthesizer/Darwin*")
|
2023-03-02 03:27:28 -05:00
|
|
|
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
2024-10-18 12:35:07 -04:00
|
|
|
list(FILTER soh__ EXCLUDE REGEX "soh/Enhancements/speechsynthesizer/SAPI*")
|
2023-03-02 03:27:28 -05:00
|
|
|
else()
|
2024-10-18 12:35:07 -04:00
|
|
|
list(FILTER soh__ EXCLUDE REGEX "soh/Enhancements/speechsynthesizer/(Darwin|SAPI).*")
|
2022-09-27 22:41:17 -04:00
|
|
|
endif()
|
|
|
|
|
2024-10-18 12:35:07 -04:00
|
|
|
# soh/Extractor {{{
|
|
|
|
list(FILTER ship__ EXCLUDE REGEX "soh/Extractor/*")
|
2023-02-28 13:19:34 -05:00
|
|
|
|
2023-04-25 00:01:17 -04:00
|
|
|
if(NOT CMAKE_SYSTEM_NAME MATCHES "NintendoSwitch|CafeOS")
|
|
|
|
file(GLOB_RECURSE soh__Extractor RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
"soh/Extractor/*.c"
|
|
|
|
"soh/Extractor/*.cpp"
|
|
|
|
"soh/Extractor/*.h"
|
|
|
|
"soh/Extractor/*.hpp"
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
file(GLOB_RECURSE soh__Extractor RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
"soh/Extractor/*.h"
|
|
|
|
"soh/Extractor/*.hpp"
|
|
|
|
)
|
|
|
|
endif()
|
2023-02-28 13:19:34 -05:00
|
|
|
# }}}
|
|
|
|
|
|
|
|
# src (decomp) {{{
|
|
|
|
file(GLOB_RECURSE src__ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.c" "src/*.h")
|
2024-10-28 20:30:11 -04:00
|
|
|
set_source_files_properties(${src__} PROPERTIES COMPILE_OPTIONS "${WARNING_OVERRIDE}")
|
2023-02-28 13:19:34 -05:00
|
|
|
|
|
|
|
list(APPEND src__ ${CMAKE_CURRENT_SOURCE_DIR}/Resource.rc)
|
|
|
|
list(FILTER src__ EXCLUDE REGEX "src/dmadata/*")
|
|
|
|
list(FILTER src__ EXCLUDE REGEX "src/elf_message/*")
|
|
|
|
list(FILTER src__ EXCLUDE REGEX "src/libultra/io/*")
|
|
|
|
list(FILTER src__ EXCLUDE REGEX "src/libultra/libc/*")
|
|
|
|
list(FILTER src__ EXCLUDE REGEX "src/libultra/os/*")
|
|
|
|
list(FILTER src__ EXCLUDE REGEX "src/libultra/rmon/*")
|
|
|
|
list(APPEND src__ "src/libultra/libc/sprintf.c")
|
|
|
|
list(REMOVE_ITEM src__ "src/libultra/gu/cosf.c")
|
|
|
|
list(REMOVE_ITEM src__ "src/libultra/gu/lookat.c")
|
|
|
|
list(REMOVE_ITEM src__ "src/libultra/gu/lookathil.c")
|
|
|
|
list(REMOVE_ITEM src__ "src/libultra/gu/perspective.c")
|
|
|
|
list(REMOVE_ITEM src__ "src/libultra/gu/position.c")
|
|
|
|
list(REMOVE_ITEM src__ "src/libultra/gu/sinf.c")
|
|
|
|
list(REMOVE_ITEM src__ "src/libultra/gu/sinf.c")
|
|
|
|
list(REMOVE_ITEM src__ "src/libultra/gu/sqrtf.c")
|
|
|
|
list(REMOVE_ITEM src__ "src/libultra/gu/us2dex.c")
|
|
|
|
|
|
|
|
source_group("src" REGULAR_EXPRESSION "src/*")
|
|
|
|
source_group("src\\boot" REGULAR_EXPRESSION "src/boot/*")
|
|
|
|
source_group("src\\buffers" REGULAR_EXPRESSION "src/buffers/*")
|
|
|
|
source_group("src\\code" REGULAR_EXPRESSION "src/code/*")
|
|
|
|
source_group("src\\libultra" REGULAR_EXPRESSION "src/libultra/*")
|
|
|
|
source_group("src\\overlays\\actors" REGULAR_EXPRESSION "src/overlays/actors/*")
|
|
|
|
source_group("src\\overlays\\effects" REGULAR_EXPRESSION "src/overlays/effects/*")
|
|
|
|
source_group("src\\overlays\\gamestates" REGULAR_EXPRESSION "src/overlays/gamestates/*")
|
|
|
|
source_group("src\\overlays\\misc" REGULAR_EXPRESSION "src/overlays/misc/*")
|
|
|
|
# }}}
|
2022-08-05 01:59:19 -04:00
|
|
|
|
|
|
|
set(ALL_FILES
|
|
|
|
${Header_Files}
|
|
|
|
${Header_Files__include}
|
2023-02-28 13:19:34 -05:00
|
|
|
${soh__}
|
2023-04-25 00:01:17 -04:00
|
|
|
${soh__Extractor}
|
2023-02-28 13:19:34 -05:00
|
|
|
${src__}
|
2022-08-05 01:59:19 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Target
|
|
|
|
################################################################################
|
2023-02-28 13:19:34 -05:00
|
|
|
add_executable(${PROJECT_NAME} ${ALL_FILES})
|
2022-08-05 01:59:19 -04:00
|
|
|
|
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
|
|
use_props(${PROJECT_NAME} "${CMAKE_CONFIGURATION_TYPES}" "${DEFAULT_CXX_PROPS}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(ROOT_NAMESPACE soh)
|
|
|
|
|
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
|
|
VS_GLOBAL_KEYWORD "Win32Proj"
|
|
|
|
)
|
|
|
|
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
|
|
INTERPROCEDURAL_OPTIMIZATION_RELEASE "TRUE"
|
|
|
|
)
|
|
|
|
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
|
|
INTERPROCEDURAL_OPTIMIZATION_RELEASE "TRUE"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
2023-06-02 16:53:07 -04:00
|
|
|
XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC YES
|
2023-03-02 03:27:28 -05:00
|
|
|
OUTPUT_NAME "soh-macos"
|
2022-08-05 01:59:19 -04:00
|
|
|
)
|
|
|
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES
|
|
|
|
OUTPUT_NAME "soh.elf"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
################################################################################
|
|
|
|
# MSVC runtime library
|
|
|
|
################################################################################
|
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
|
|
get_property(MSVC_RUNTIME_LIBRARY_DEFAULT TARGET ${PROJECT_NAME} PROPERTY MSVC_RUNTIME_LIBRARY)
|
|
|
|
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
|
|
|
string(CONCAT "MSVC_RUNTIME_LIBRARY_STR"
|
|
|
|
$<$<CONFIG:Debug>:
|
|
|
|
MultiThreadedDebug
|
|
|
|
>
|
|
|
|
$<$<CONFIG:Release>:
|
|
|
|
MultiThreaded
|
|
|
|
>
|
|
|
|
$<$<NOT:$<OR:$<CONFIG:Debug>,$<CONFIG:Release>>>:${MSVC_RUNTIME_LIBRARY_DEFAULT}>
|
|
|
|
)
|
|
|
|
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
|
|
|
|
string(CONCAT "MSVC_RUNTIME_LIBRARY_STR"
|
|
|
|
$<$<CONFIG:Debug>:
|
|
|
|
MultiThreadedDebug
|
|
|
|
>
|
|
|
|
$<$<CONFIG:Release>:
|
|
|
|
MultiThreaded
|
|
|
|
>
|
|
|
|
$<$<NOT:$<OR:$<CONFIG:Debug>,$<CONFIG:Release>>>:${MSVC_RUNTIME_LIBRARY_DEFAULT}>
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
set_target_properties(${PROJECT_NAME} PROPERTIES MSVC_RUNTIME_LIBRARY ${MSVC_RUNTIME_LIBRARY_STR})
|
|
|
|
endif()
|
|
|
|
################################################################################
|
2023-01-25 18:33:27 -05:00
|
|
|
# Find/download Boost
|
|
|
|
################################################################################
|
|
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
|
|
Boost
|
2024-01-08 13:39:49 -05:00
|
|
|
URL https://archives.boost.io/release/1.81.0/source/boost_1_81_0.tar.gz
|
2023-01-25 18:33:27 -05:00
|
|
|
URL_HASH SHA256=205666dea9f6a7cfed87c7a6dfbeb52a2c1b9de55712c9c1a87735d7181452b6
|
|
|
|
SOURCE_SUBDIR "null" # Set to a nonexistent directory so boost is not built (we don't need to build it)
|
|
|
|
DOWNLOAD_EXTRACT_TIMESTAMP false # supress timestamp warning, not needed since the url wont change
|
|
|
|
)
|
|
|
|
|
|
|
|
set(Boost_NO_BOOST_CMAKE false)
|
|
|
|
set(BOOST_INCLUDEDIR ${FETCHCONTENT_BASE_DIR}/boost-src) # Location where FetchContent stores the source
|
|
|
|
message("Searching for Boost installation")
|
|
|
|
find_package(Boost)
|
|
|
|
|
|
|
|
if (NOT ${Boost_FOUND})
|
|
|
|
message("Boost not found. Downloading now...")
|
|
|
|
FetchContent_MakeAvailable(Boost)
|
|
|
|
message("Boost downloaded to " ${FETCHCONTENT_BASE_DIR}/boost-src)
|
|
|
|
set(BOOST-INCLUDE ${FETCHCONTENT_BASE_DIR}/boost-src)
|
|
|
|
else()
|
|
|
|
message("Boost found in " ${Boost_INCLUDE_DIRS})
|
|
|
|
set(BOOST-INCLUDE ${Boost_INCLUDE_DIRS})
|
|
|
|
endif()
|
|
|
|
################################################################################
|
2022-08-05 01:59:19 -04:00
|
|
|
# Compile definitions
|
|
|
|
################################################################################
|
2022-08-16 03:29:45 -04:00
|
|
|
find_package(SDL2)
|
|
|
|
set(SDL2-INCLUDE ${SDL2_INCLUDE_DIRS})
|
2022-08-05 01:59:19 -04:00
|
|
|
|
2023-12-17 14:41:33 -05:00
|
|
|
if (BUILD_REMOTE_CONTROL)
|
2022-10-29 12:23:26 -04:00
|
|
|
find_package(SDL2_net)
|
2024-02-15 21:13:49 -05:00
|
|
|
|
|
|
|
if(NOT SDL2_net_FOUND)
|
|
|
|
message(STATUS "SDL2_net not found (it's possible the version installed is too old). Disabling BUILD_REMOTE_CONTROL.")
|
|
|
|
set(BUILD_REMOTE_CONTROL 0)
|
|
|
|
else()
|
|
|
|
set(SDL2-NET-INCLUDE ${SDL_NET_INCLUDE_DIRS})
|
|
|
|
endif()
|
2022-09-27 22:41:17 -04:00
|
|
|
endif()
|
|
|
|
|
2022-08-05 01:59:19 -04:00
|
|
|
target_include_directories(${PROJECT_NAME} PRIVATE assets
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/include/
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/src/
|
2022-09-03 00:00:04 -04:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship
|
2022-11-14 05:22:34 -05:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/include
|
2023-06-03 15:27:45 -04:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src
|
2022-11-14 05:22:34 -05:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/log
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/debug
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/menu
|
2023-06-03 15:27:45 -04:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/utils
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/utils/binarytools
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/config
|
2022-11-14 05:22:34 -05:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/resource
|
2023-01-17 00:17:49 -05:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/resource/type
|
2023-06-03 15:27:45 -04:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/resource/factory
|
2022-11-14 05:22:34 -05:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/audio
|
2023-06-03 15:27:45 -04:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/window
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/window/gui
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/config
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/public
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/public/libultra
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/public/bridge
|
2022-11-14 05:22:34 -05:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/extern
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/extern/tinyxml2
|
2022-09-03 00:00:04 -04:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/libultraship/Lib/
|
2022-08-05 01:59:19 -04:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/libultraship/Lib/libjpeg/include/
|
2022-11-14 05:22:34 -05:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/graphic/Fast3D/U64/PR
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../libultraship/src/graphic
|
2023-01-17 00:17:49 -05:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../ZAPDTR/ZAPD/resource/type
|
2022-08-05 01:59:19 -04:00
|
|
|
${SDL2-INCLUDE}
|
2022-09-27 22:41:17 -04:00
|
|
|
${SDL2-NET-INCLUDE}
|
2023-01-25 18:33:27 -05:00
|
|
|
${BOOST-INCLUDE}
|
2022-08-05 01:59:19 -04:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/assets/
|
|
|
|
.
|
|
|
|
)
|
|
|
|
|
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
|
|
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
|
|
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
|
|
|
"$<$<CONFIG:Debug>:"
|
|
|
|
"_DEBUG;"
|
|
|
|
"_CRT_SECURE_NO_WARNINGS;"
|
2022-09-27 22:41:17 -04:00
|
|
|
"ENABLE_DX11;"
|
2022-08-05 01:59:19 -04:00
|
|
|
">"
|
|
|
|
"$<$<CONFIG:Release>:"
|
|
|
|
"NDEBUG"
|
|
|
|
">"
|
2023-12-17 14:41:33 -05:00
|
|
|
"$<$<BOOL:${BUILD_REMOTE_CONTROL}>:ENABLE_REMOTE_CONTROL>"
|
2022-08-05 01:59:19 -04:00
|
|
|
"INCLUDE_GAME_PRINTF;"
|
2024-05-27 18:33:02 -04:00
|
|
|
"F3DEX_GBI_2"
|
2022-08-05 01:59:19 -04:00
|
|
|
"UNICODE;"
|
|
|
|
"_UNICODE"
|
|
|
|
STORMLIB_NO_AUTO_LINK
|
|
|
|
"_CRT_SECURE_NO_WARNINGS;"
|
2024-04-30 18:50:06 -04:00
|
|
|
NOMINMAX
|
2022-08-05 01:59:19 -04:00
|
|
|
)
|
|
|
|
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
|
|
|
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
|
|
|
"$<$<CONFIG:Debug>:"
|
|
|
|
"NOINCLUDE_GAME_PRINTF;"
|
|
|
|
"_DEBUG;"
|
|
|
|
"_CRT_SECURE_NO_WARNINGS;"
|
|
|
|
"ENABLE_OPENGL"
|
|
|
|
">"
|
|
|
|
"$<$<CONFIG:Release>:"
|
|
|
|
"NDEBUG;"
|
|
|
|
">"
|
2022-09-20 23:23:47 -04:00
|
|
|
"INCLUDE_GAME_PRINTF;"
|
2024-05-27 18:33:02 -04:00
|
|
|
"F3DEX_GBI_2"
|
2022-08-05 01:59:19 -04:00
|
|
|
"WIN32;"
|
|
|
|
"UNICODE;"
|
|
|
|
"_UNICODE"
|
|
|
|
STORMLIB_NO_AUTO_LINK
|
2024-04-30 18:50:06 -04:00
|
|
|
NOMINMAX
|
2022-08-05 01:59:19 -04:00
|
|
|
)
|
|
|
|
endif()
|
2022-08-14 22:57:24 -04:00
|
|
|
elseif (CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
|
|
|
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
|
|
|
"$<$<CONFIG:Debug>:"
|
2022-09-20 23:23:47 -04:00
|
|
|
"_DEBUG"
|
2022-08-14 22:57:24 -04:00
|
|
|
">"
|
|
|
|
"$<$<CONFIG:Release>:"
|
|
|
|
"NDEBUG"
|
|
|
|
">"
|
2024-05-27 18:33:02 -04:00
|
|
|
"F3DEX_GBI_2"
|
2022-08-14 22:57:24 -04:00
|
|
|
"SPDLOG_ACTIVE_LEVEL=3;"
|
|
|
|
"SPDLOG_NO_THREAD_ID;"
|
|
|
|
"SPDLOG_NO_TLS;"
|
|
|
|
"STBI_NO_THREAD_LOCALS;"
|
|
|
|
)
|
|
|
|
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang|AppleClang")
|
2022-08-05 01:59:19 -04:00
|
|
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
|
|
|
"$<$<CONFIG:Debug>:"
|
2022-09-20 23:23:47 -04:00
|
|
|
"_DEBUG"
|
2022-08-05 01:59:19 -04:00
|
|
|
">"
|
|
|
|
"$<$<CONFIG:Release>:"
|
|
|
|
"NDEBUG"
|
|
|
|
">"
|
2024-05-27 18:33:02 -04:00
|
|
|
"F3DEX_GBI_2"
|
2023-12-17 14:41:33 -05:00
|
|
|
"$<$<BOOL:${BUILD_REMOTE_CONTROL}>:ENABLE_REMOTE_CONTROL>"
|
2022-08-05 01:59:19 -04:00
|
|
|
"SPDLOG_ACTIVE_LEVEL=0;"
|
|
|
|
"_CONSOLE;"
|
|
|
|
"_CRT_SECURE_NO_WARNINGS;"
|
|
|
|
"ENABLE_OPENGL;"
|
|
|
|
"UNICODE;"
|
|
|
|
"_UNICODE"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
################################################################################
|
|
|
|
# Compile and link options
|
|
|
|
################################################################################
|
|
|
|
if(MSVC)
|
|
|
|
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
|
|
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
|
|
|
$<$<CONFIG:Debug>:
|
2022-08-23 03:32:49 -04:00
|
|
|
/w;
|
|
|
|
/Od
|
2022-08-05 01:59:19 -04:00
|
|
|
>
|
|
|
|
$<$<CONFIG:Release>:
|
|
|
|
/Oi;
|
|
|
|
/Gy;
|
|
|
|
/W3
|
|
|
|
>
|
2022-08-23 03:32:49 -04:00
|
|
|
/sdl-;
|
2022-08-05 01:59:19 -04:00
|
|
|
/permissive-;
|
|
|
|
/MP;
|
|
|
|
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT};
|
|
|
|
${DEFAULT_CXX_EXCEPTION_HANDLING}
|
|
|
|
)
|
2022-12-04 23:25:24 -05:00
|
|
|
target_compile_options(${PROJECT_NAME} PRIVATE $<$<CONFIG:Debug>:/ZI;>)
|
2022-08-05 01:59:19 -04:00
|
|
|
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
|
|
|
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
|
|
|
$<$<CONFIG:Debug>:
|
|
|
|
/RTCs
|
|
|
|
>
|
|
|
|
$<$<CONFIG:Release>:
|
|
|
|
/O2;
|
|
|
|
/Oi;
|
|
|
|
/Gy
|
|
|
|
>
|
|
|
|
/permissive-;
|
|
|
|
/MP;
|
|
|
|
/sdl-;
|
|
|
|
/w;
|
|
|
|
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT};
|
|
|
|
${DEFAULT_CXX_EXCEPTION_HANDLING}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
|
|
|
target_link_options(${PROJECT_NAME} PRIVATE
|
|
|
|
$<$<CONFIG:Debug>:
|
|
|
|
/INCREMENTAL
|
|
|
|
>
|
|
|
|
$<$<CONFIG:Release>:
|
|
|
|
/OPT:REF;
|
|
|
|
/OPT:ICF;
|
2022-12-04 23:25:24 -05:00
|
|
|
/INCREMENTAL:NO;
|
|
|
|
/FORCE:MULTIPLE
|
2022-08-05 01:59:19 -04:00
|
|
|
>
|
2023-05-17 22:21:26 -04:00
|
|
|
/MANIFEST:NO;
|
2022-08-05 01:59:19 -04:00
|
|
|
/DEBUG;
|
2023-04-25 00:01:17 -04:00
|
|
|
/SUBSYSTEM:WINDOWS
|
2022-08-05 01:59:19 -04:00
|
|
|
)
|
|
|
|
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
|
|
|
|
target_link_options(${PROJECT_NAME} PRIVATE
|
|
|
|
$<$<CONFIG:Debug>:
|
|
|
|
/STACK:8777216
|
|
|
|
>
|
|
|
|
$<$<CONFIG:Release>:
|
|
|
|
/OPT:REF;
|
|
|
|
/OPT:ICF;
|
|
|
|
/INCREMENTAL:NO;
|
|
|
|
/FORCE:MULTIPLE
|
|
|
|
>
|
2023-05-17 22:21:26 -04:00
|
|
|
/MANIFEST:NO;
|
2022-08-05 01:59:19 -04:00
|
|
|
/DEBUG;
|
2022-09-20 23:23:47 -04:00
|
|
|
/SUBSYSTEM:WINDOWS
|
2022-08-05 01:59:19 -04:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
|
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
|
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
|
|
|
-Wall -Wextra -Wno-error
|
|
|
|
-Wno-return-type
|
|
|
|
-Wno-unused-parameter
|
|
|
|
-Wno-unused-function
|
|
|
|
-Wno-unused-variable
|
|
|
|
-Wno-missing-field-initializers
|
|
|
|
-Wno-parentheses
|
|
|
|
-Wno-narrowing
|
2022-09-29 19:07:48 -04:00
|
|
|
-Wno-missing-braces
|
2024-05-08 19:30:22 -04:00
|
|
|
-Wno-int-conversion
|
2023-06-27 19:53:35 -04:00
|
|
|
$<$<COMPILE_LANGUAGE:C>:
|
|
|
|
-Werror-implicit-function-declaration
|
|
|
|
-Wno-incompatible-pointer-types
|
|
|
|
>
|
2022-08-05 01:59:19 -04:00
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:-fpermissive>
|
2023-06-27 19:53:35 -04:00
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:
|
|
|
|
-Wno-c++11-narrowing
|
|
|
|
-Wno-deprecated-enum-enum-conversion
|
|
|
|
>
|
2022-08-05 01:59:19 -04:00
|
|
|
-pthread
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_options(${PROJECT_NAME} PRIVATE
|
|
|
|
-pthread
|
|
|
|
)
|
|
|
|
elseif (CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch")
|
|
|
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
|
|
|
-Wall -Wextra -Wno-error
|
|
|
|
-Wno-return-type
|
|
|
|
-Wno-unused-parameter
|
|
|
|
-Wno-unused-function
|
|
|
|
-Wno-unused-variable
|
|
|
|
-Wno-missing-field-initializers
|
|
|
|
-Wno-parentheses
|
|
|
|
-Wno-narrowing
|
2022-09-29 19:07:48 -04:00
|
|
|
-Wno-missing-braces
|
2023-06-27 19:53:35 -04:00
|
|
|
$<$<COMPILE_LANGUAGE:C>:
|
|
|
|
-Werror-implicit-function-declaration
|
|
|
|
-Wno-incompatible-pointer-types
|
|
|
|
>
|
2022-08-05 01:59:19 -04:00
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:-fpermissive>
|
2023-06-27 19:53:35 -04:00
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:
|
|
|
|
-Wno-c++11-narrowing
|
|
|
|
-Wno-deprecated-enum-enum-conversion
|
|
|
|
>
|
2022-08-05 01:59:19 -04:00
|
|
|
-pthread
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_options(${PROJECT_NAME} PRIVATE
|
|
|
|
-pthread
|
|
|
|
)
|
2022-08-14 22:57:24 -04:00
|
|
|
elseif (CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
|
|
|
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
|
|
|
-O2
|
|
|
|
|
|
|
|
# disable some warnings to not clutter output
|
|
|
|
-Wno-multichar
|
|
|
|
-Wno-return-type
|
|
|
|
-Wno-narrowing
|
|
|
|
-Wno-switch-outside-range
|
|
|
|
$<$<COMPILE_LANGUAGE:C>:
|
2023-06-27 19:53:35 -04:00
|
|
|
-Werror-implicit-function-declaration
|
2022-08-14 22:57:24 -04:00
|
|
|
-Wno-incompatible-pointer-types
|
|
|
|
-Wno-discarded-array-qualifiers
|
|
|
|
-Wno-discarded-qualifiers
|
|
|
|
-Wno-int-conversion
|
|
|
|
-Wno-builtin-declaration-mismatch
|
|
|
|
-Wno-switch-unreachable
|
|
|
|
-Wno-stringop-overflow
|
|
|
|
>
|
|
|
|
)
|
2022-08-05 01:59:19 -04:00
|
|
|
else()
|
|
|
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
|
|
|
|
set(CPU_OPTION -msse2 -mfpmath=sse)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
|
|
|
-Wall -Wextra -Wno-error
|
|
|
|
-Wno-unused-parameter
|
|
|
|
-Wno-unused-function
|
|
|
|
-Wno-unused-variable
|
|
|
|
-Wno-missing-field-initializers
|
|
|
|
-Wno-parentheses
|
|
|
|
-Wno-narrowing
|
2022-09-29 19:07:48 -04:00
|
|
|
-Wno-missing-braces
|
2024-02-15 21:13:49 -05:00
|
|
|
-Wno-int-conversion
|
|
|
|
-Wno-implicit-int
|
2023-06-27 19:53:35 -04:00
|
|
|
$<$<COMPILE_LANGUAGE:C>:
|
|
|
|
-Werror-implicit-function-declaration
|
|
|
|
-Wno-incompatible-pointer-types
|
|
|
|
>
|
2022-08-05 01:59:19 -04:00
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:-fpermissive>
|
|
|
|
$<$<COMPILE_LANGUAGE:CXX>:-Wno-deprecated-enum-enum-conversion>
|
|
|
|
-pthread
|
|
|
|
${CPU_OPTION}
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_options(${PROJECT_NAME} PRIVATE
|
|
|
|
-pthread
|
|
|
|
-Wl,-export-dynamic
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
################################################################################
|
|
|
|
# Pre build events
|
|
|
|
################################################################################
|
2024-10-28 03:02:04 -04:00
|
|
|
if (MSVC)
|
|
|
|
set(MSVC_CMD ${CMAKE_COMMAND} -E copy_directory $<TARGET_FILE_DIR:soh>/assets ${CMAKE_BINARY_DIR}/soh/assets)
|
|
|
|
endif()
|
2023-04-25 00:01:17 -04:00
|
|
|
if(NOT CMAKE_SYSTEM_NAME MATCHES "NintendoSwitch|CafeOS")
|
|
|
|
add_custom_command(
|
|
|
|
TARGET ${PROJECT_NAME}
|
|
|
|
POST_BUILD
|
|
|
|
COMMENT "Copying asset xmls..."
|
2023-06-13 09:29:36 -04:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/soh/assets/extractor $<TARGET_FILE_DIR:soh>/assets/extractor
|
2023-04-25 00:01:17 -04:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/soh/assets/xml $<TARGET_FILE_DIR:soh>/assets/extractor/xmls
|
2023-06-13 09:29:36 -04:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/OTRExporter/CFG/filelists $<TARGET_FILE_DIR:soh>/assets/extractor/filelists
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:soh>/assets/extractor/symbols
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/OTRExporter/CFG/ActorList_OoTMqDbg.txt $<TARGET_FILE_DIR:soh>/assets/extractor/symbols
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/OTRExporter/CFG/ObjectList_OoTMqDbg.txt $<TARGET_FILE_DIR:soh>/assets/extractor/symbols
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/OTRExporter/CFG/SymbolMap_OoTMqDbg.txt $<TARGET_FILE_DIR:soh>/assets/extractor/symbols
|
2024-10-28 03:02:04 -04:00
|
|
|
COMMAND ${MSVC_CMD}
|
2023-06-13 09:29:36 -04:00
|
|
|
)
|
2023-04-25 00:01:17 -04:00
|
|
|
endif()
|
2022-08-05 01:59:19 -04:00
|
|
|
################################################################################
|
|
|
|
# Dependencies
|
|
|
|
################################################################################
|
|
|
|
add_dependencies(${PROJECT_NAME}
|
|
|
|
libultraship
|
|
|
|
)
|
2023-04-25 00:01:17 -04:00
|
|
|
if(NOT CMAKE_SYSTEM_NAME MATCHES "NintendoSwitch|CafeOS")
|
|
|
|
add_dependencies(${PROJECT_NAME}
|
|
|
|
ZAPDLib
|
|
|
|
)
|
|
|
|
endif()
|
2022-08-05 01:59:19 -04:00
|
|
|
|
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
2023-06-13 09:29:36 -04:00
|
|
|
find_package(glfw3 REQUIRED)
|
2022-08-05 01:59:19 -04:00
|
|
|
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
|
|
|
set(ADDITIONAL_LIBRARY_DEPENDENCIES
|
|
|
|
"libultraship;"
|
2023-04-25 00:01:17 -04:00
|
|
|
"ZAPDLib;"
|
2022-08-05 01:59:19 -04:00
|
|
|
"glu32;"
|
2022-08-16 03:29:45 -04:00
|
|
|
"SDL2::SDL2;"
|
|
|
|
"SDL2::SDL2main;"
|
2023-12-17 14:41:33 -05:00
|
|
|
"$<$<BOOL:${BUILD_REMOTE_CONTROL}>:SDL2_net::SDL2_net-static>"
|
2022-08-16 03:29:45 -04:00
|
|
|
"glfw;"
|
2022-08-05 01:59:19 -04:00
|
|
|
"winmm;"
|
|
|
|
"imm32;"
|
|
|
|
"version;"
|
|
|
|
"setupapi"
|
|
|
|
)
|
2023-06-01 21:39:50 -04:00
|
|
|
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
|
2022-08-05 01:59:19 -04:00
|
|
|
set(ADDITIONAL_LIBRARY_DEPENDENCIES
|
|
|
|
"libultraship;"
|
2023-04-25 00:01:17 -04:00
|
|
|
"ZAPDLib;"
|
2022-08-05 01:59:19 -04:00
|
|
|
"glu32;"
|
2022-08-16 03:29:45 -04:00
|
|
|
"SDL2::SDL2;"
|
|
|
|
"SDL2::SDL2main;"
|
|
|
|
"glfw;"
|
2022-08-05 01:59:19 -04:00
|
|
|
"winmm;"
|
|
|
|
"imm32;"
|
|
|
|
"version;"
|
|
|
|
"setupapi"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch")
|
|
|
|
find_package(SDL2)
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
set(ADDITIONAL_LIBRARY_DEPENDENCIES
|
|
|
|
"libultraship;"
|
|
|
|
SDL2::SDL2
|
|
|
|
-lglad
|
|
|
|
Threads::Threads
|
|
|
|
)
|
2022-08-14 22:57:24 -04:00
|
|
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "CafeOS")
|
|
|
|
find_package(SDL2 REQUIRED)
|
|
|
|
set(ADDITIONAL_LIBRARY_DEPENDENCIES
|
|
|
|
"libultraship;"
|
|
|
|
SDL2::SDL2-static
|
|
|
|
|
|
|
|
"$<$<CONFIG:Debug>:-Wl,--wrap=abort>"
|
|
|
|
)
|
|
|
|
target_include_directories(${PROJECT_NAME} PRIVATE
|
|
|
|
${DEVKITPRO}/portlibs/wiiu/include/
|
|
|
|
)
|
2022-08-05 01:59:19 -04:00
|
|
|
else()
|
|
|
|
find_package(SDL2)
|
|
|
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
|
|
|
find_package(Threads REQUIRED)
|
|
|
|
set(ADDITIONAL_LIBRARY_DEPENDENCIES
|
|
|
|
"libultraship;"
|
2023-04-25 00:01:17 -04:00
|
|
|
"ZAPDLib;"
|
2022-08-05 01:59:19 -04:00
|
|
|
SDL2::SDL2
|
2023-12-17 14:41:33 -05:00
|
|
|
"$<$<BOOL:${BUILD_REMOTE_CONTROL}>:SDL2_net::SDL2_net>"
|
2022-08-05 01:59:19 -04:00
|
|
|
${CMAKE_DL_LIBS}
|
|
|
|
Threads::Threads
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2022-08-14 22:57:24 -04:00
|
|
|
if(NOT CMAKE_SYSTEM_NAME MATCHES "NintendoSwitch|CafeOS")
|
2022-08-05 01:59:19 -04:00
|
|
|
INSTALL(TARGETS soh DESTINATION . COMPONENT ship)
|
|
|
|
endif()
|
|
|
|
|
2022-09-11 23:15:10 -04:00
|
|
|
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|
|
|
INSTALL(FILES $<TARGET_PDB_FILE:soh> DESTINATION ./debug COMPONENT ship)
|
2023-10-09 11:28:22 -04:00
|
|
|
INSTALL(FILES ${CMAKE_BINARY_DIR}/soh/soh.otr DESTINATION . COMPONENT ship)
|
2022-09-11 23:15:10 -04:00
|
|
|
endif()
|
|
|
|
|
2023-11-05 12:34:39 -05:00
|
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
|
|
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/linux/appimage/soh.sh.in ${CMAKE_BINARY_DIR}/linux/soh.sh @ONLY)
|
|
|
|
endif()
|
|
|
|
|
2022-08-05 01:59:19 -04:00
|
|
|
find_program(CURL NAMES curl DOC "Path to the curl program. Used to download files.")
|
|
|
|
execute_process(COMMAND ${CURL} -sSfL https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt -o ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt OUTPUT_VARIABLE RESULT)
|
|
|
|
|
|
|
|
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
|
2022-10-03 19:13:29 -04:00
|
|
|
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/macosx/Info.plist.in ${CMAKE_BINARY_DIR}/macosx/Info.plist @ONLY)
|
2023-11-05 12:34:39 -05:00
|
|
|
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/macosx/soh-macos.sh.in ${CMAKE_BINARY_DIR}/macosx/soh-macos.sh @ONLY)
|
2022-08-05 01:59:19 -04:00
|
|
|
INSTALL(FILES ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt DESTINATION ../MacOS COMPONENT ship)
|
2023-04-12 21:14:33 -04:00
|
|
|
INSTALL(FILES ${CMAKE_BINARY_DIR}/soh/soh.otr DESTINATION ../Resources COMPONENT ship)
|
2022-08-14 22:57:24 -04:00
|
|
|
elseif(NOT "${CMAKE_SYSTEM_NAME}" MATCHES "NintendoSwitch|CafeOS")
|
2022-08-05 01:59:19 -04:00
|
|
|
INSTALL(FILES ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt DESTINATION . COMPONENT ship)
|
|
|
|
endif()
|
|
|
|
|
2022-08-14 22:57:24 -04:00
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "NintendoSwitch|CafeOS")
|
2022-08-05 01:59:19 -04:00
|
|
|
if (NOT TARGET pathconf)
|
2022-08-14 22:57:24 -04:00
|
|
|
add_library(pathconf OBJECT platform/pathconf.c)
|
2022-08-05 01:59:19 -04:00
|
|
|
endif()
|
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE "${ADDITIONAL_LIBRARY_DEPENDENCIES}" $<TARGET_OBJECTS:pathconf> )
|
|
|
|
else()
|
|
|
|
target_link_libraries(${PROJECT_NAME} PRIVATE "${ADDITIONAL_LIBRARY_DEPENDENCIES}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_SYSTEM_NAME MATCHES "NintendoSwitch")
|
|
|
|
|
2022-08-07 10:47:16 -04:00
|
|
|
nx_generate_nacp(Ship.nacp
|
|
|
|
NAME "Ship of Harkinian"
|
2022-10-03 19:13:29 -04:00
|
|
|
AUTHOR "${PROJECT_TEAM}"
|
|
|
|
VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
|
2022-08-07 10:47:16 -04:00
|
|
|
)
|
2023-06-01 21:39:50 -04:00
|
|
|
|
2022-08-07 10:47:16 -04:00
|
|
|
nx_create_nro(soh
|
|
|
|
NACP Ship.nacp
|
|
|
|
ICON ${CMAKE_CURRENT_SOURCE_DIR}/icon.jpg
|
|
|
|
)
|
2022-08-05 01:59:19 -04:00
|
|
|
|
|
|
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/soh.nro DESTINATION . COMPONENT ship)
|
|
|
|
|
2022-08-14 22:57:24 -04:00
|
|
|
elseif(CMAKE_SYSTEM_NAME MATCHES "CafeOS")
|
|
|
|
|
|
|
|
wut_create_rpx(${PROJECT_NAME})
|
|
|
|
|
2022-09-08 22:55:55 -04:00
|
|
|
wut_create_wuhb(${PROJECT_NAME}
|
|
|
|
NAME "Ship of Harkinian"
|
|
|
|
SHORTNAME "SoH"
|
2022-10-03 19:13:29 -04:00
|
|
|
AUTHOR "${PROJECT_TEAM}"
|
2022-09-08 22:55:55 -04:00
|
|
|
ICON ${CMAKE_CURRENT_SOURCE_DIR}/icon.jpg
|
|
|
|
)
|
|
|
|
|
|
|
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/soh.rpx ${CMAKE_CURRENT_BINARY_DIR}/soh.wuhb DESTINATION . COMPONENT ship)
|
2022-08-14 22:57:24 -04:00
|
|
|
|
2022-08-05 01:59:19 -04:00
|
|
|
endif()
|