Merge branch 'develop' into aManchipelago
This commit is contained in:
@@ -138,20 +138,27 @@ endforeach()
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
set_source_files_properties(soh/OTRGlobals.cpp PROPERTIES COMPILE_FLAGS "/utf-8")
|
||||
set_source_files_properties(soh/Enhancements/tts/tts.cpp PROPERTIES COMPILE_FLAGS "/utf-8")
|
||||
set_source_files_properties(soh/Enhancements/custom-message/CustomMessageManager.cpp PROPERTIES COMPILE_FLAGS "/utf-8")
|
||||
set_source_files_properties(soh/Enhancements/custom-message/CustomMessageManager.h PROPERTIES COMPILE_FLAGS "/utf-8")
|
||||
endif()
|
||||
|
||||
# handle Network removals
|
||||
if (!BUILD_REMOTE_CONTROL)
|
||||
list(FILTER soh__ EXCLUDE REGEX "soh/Enhancements/crowd-control/*")
|
||||
list(FILTER soh__ EXCLUDE REGEX "soh/Enhancements/crowd-control/")
|
||||
endif()
|
||||
|
||||
# handle speechsynthesizer removals
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
list(FILTER soh__ EXCLUDE REGEX "soh/Enhancements/speechsynthesizer/Darwin*")
|
||||
list(FILTER soh__ EXCLUDE REGEX "soh/Enhancements/speechsynthesizer/Darwin")
|
||||
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||
list(FILTER soh__ EXCLUDE REGEX "soh/Enhancements/speechsynthesizer/SAPI*")
|
||||
list(FILTER soh__ EXCLUDE REGEX "soh/Enhancements/speechsynthesizer/SAPI")
|
||||
else()
|
||||
list(FILTER soh__ EXCLUDE REGEX "soh/Enhancements/speechsynthesizer/(Darwin|SAPI).*")
|
||||
list(FILTER soh__ EXCLUDE REGEX "soh/Enhancements/speechsynthesizer/(Darwin|SAPI)")
|
||||
endif()
|
||||
|
||||
find_library(ESPEAK espeak-ng)
|
||||
if (NOT ESPEAK)
|
||||
list(FILTER soh__ EXCLUDE REGEX "soh/Enhancements/speechsynthesizer/ESpeak")
|
||||
endif()
|
||||
|
||||
# soh/Extractor {{{
|
||||
@@ -177,12 +184,12 @@ file(GLOB_RECURSE src__ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.c" "src/*.h"
|
||||
set_source_files_properties(${src__} PROPERTIES COMPILE_OPTIONS "${WARNING_OVERRIDE}")
|
||||
|
||||
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(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")
|
||||
@@ -286,7 +293,19 @@ target_include_directories(${PROJECT_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../subprojects/wswrap/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../subprojects/valijson/include
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../subprojects/apclientpp
|
||||
|
||||
|
||||
# Find/download Dr Libs (For custom audio)
|
||||
################################################################################
|
||||
include(FetchContent)
|
||||
|
||||
FetchContent_Declare(
|
||||
dr_libs
|
||||
GIT_REPOSITORY https://github.com/mackron/dr_libs.git
|
||||
GIT_TAG da35f9d6c7374a95353fd1df1d394d44ab66cf01
|
||||
)
|
||||
FetchContent_MakeAvailable(dr_libs)
|
||||
|
||||
|
||||
################################################################################
|
||||
# Compile definitions
|
||||
@@ -322,6 +341,14 @@ if (BUILD_REMOTE_CONTROL)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (ESPEAK)
|
||||
add_compile_definitions(ESPEAK=1)
|
||||
endif()
|
||||
|
||||
################################################################################
|
||||
# Compile definitions
|
||||
################################################################################
|
||||
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE assets
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src/
|
||||
@@ -354,6 +381,7 @@ target_include_directories(${PROJECT_NAME} PRIVATE assets
|
||||
${SDL2-INCLUDE}
|
||||
${SDL2-NET-INCLUDE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/assets/
|
||||
${dr_libs_SOURCE_DIR}
|
||||
.
|
||||
)
|
||||
|
||||
@@ -606,6 +634,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
|
||||
|
||||
target_link_options(${PROJECT_NAME} PRIVATE
|
||||
-pthread
|
||||
#-fsanitize=address
|
||||
-Wl,-export-dynamic
|
||||
)
|
||||
endif()
|
||||
@@ -614,21 +643,22 @@ endif()
|
||||
# Pre build events
|
||||
################################################################################
|
||||
if (CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
set(VS_COPY_ASSETS_CMD ${CMAKE_COMMAND} -E copy_directory_if_different $<TARGET_FILE_DIR:soh>/assets ${CMAKE_BINARY_DIR}/soh/assets)
|
||||
add_custom_command(
|
||||
TARGET ${PROJECT_NAME}
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_SOURCE_DIR}/soh/assets/extractor ${CMAKE_BINARY_DIR}/soh/assets
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_SOURCE_DIR}/soh/assets/xml ${CMAKE_BINARY_DIR}/soh/assets/xml
|
||||
)
|
||||
endif()
|
||||
if(NOT CMAKE_SYSTEM_NAME MATCHES "NintendoSwitch|CafeOS")
|
||||
add_custom_command(
|
||||
TARGET ${PROJECT_NAME}
|
||||
POST_BUILD
|
||||
COMMENT "Copying asset xmls..."
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_SOURCE_DIR}/soh/assets/extractor $<TARGET_FILE_DIR:soh>/assets/extractor
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_SOURCE_DIR}/soh/assets/xml $<TARGET_FILE_DIR:soh>/assets/extractor/xmls
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${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_if_different ${CMAKE_SOURCE_DIR}/OTRExporter/CFG/ActorList_OoTMqDbg.txt $<TARGET_FILE_DIR:soh>/assets/extractor/symbols
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/OTRExporter/CFG/ObjectList_OoTMqDbg.txt $<TARGET_FILE_DIR:soh>/assets/extractor/symbols
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/OTRExporter/CFG/SymbolMap_OoTMqDbg.txt $<TARGET_FILE_DIR:soh>/assets/extractor/symbols
|
||||
COMMAND ${VS_COPY_ASSETS_CMD}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_SOURCE_DIR}/soh/assets/extractor $<TARGET_FILE_DIR:soh>/assets
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different ${CMAKE_SOURCE_DIR}/soh/assets/xml $<TARGET_FILE_DIR:soh>/assets/xml
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory $<TARGET_FILE_DIR:soh>/assets/symbols
|
||||
# COMMAND ${VS_COPY_ASSETS_CMD}
|
||||
)
|
||||
endif()
|
||||
################################################################################
|
||||
@@ -645,6 +675,15 @@ endif()
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
find_package(glfw3 REQUIRED)
|
||||
find_package(Ogg CONFIG REQUIRED)
|
||||
link_libraries(Ogg::ogg)
|
||||
|
||||
find_package(Vorbis CONFIG REQUIRED)
|
||||
link_libraries(Vorbis::vorbisfile)
|
||||
find_package(Opus CONFIG REQUIRED)
|
||||
link_libraries(Opus::opus)
|
||||
find_package(OpusFile CONFIG REQUIRED)
|
||||
link_libraries(OpusFile::opusfile CONFIG REQUIRED)
|
||||
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64")
|
||||
set(ADDITIONAL_LIBRARY_DEPENDENCIES
|
||||
"libultraship;"
|
||||
@@ -660,6 +699,12 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
"imm32;"
|
||||
"version;"
|
||||
"setupapi"
|
||||
"Ogg::ogg"
|
||||
"Opus::opus"
|
||||
"Vorbis::vorbis"
|
||||
"Vorbis::vorbisenc"
|
||||
"Vorbis::vorbisfile"
|
||||
"OpusFile::opusfile"
|
||||
)
|
||||
elseif("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "Win32")
|
||||
set(ADDITIONAL_LIBRARY_DEPENDENCIES
|
||||
@@ -700,10 +745,21 @@ else()
|
||||
find_package(SDL2)
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(Ogg REQUIRED)
|
||||
find_package(Vorbis REQUIRED)
|
||||
find_package(Opus REQUIRED)
|
||||
find_package(OpusFile REQUIRED)
|
||||
set(ADDITIONAL_LIBRARY_DEPENDENCIES
|
||||
"libultraship;"
|
||||
"ZAPDLib;"
|
||||
SDL2::SDL2
|
||||
"Ogg::ogg"
|
||||
"Vorbis::vorbis"
|
||||
"Vorbis::vorbisenc"
|
||||
"Vorbis::vorbisfile"
|
||||
"Opus::opus"
|
||||
"Opusfile::Opusfile"
|
||||
"$<$<BOOL:${BUILD_REMOTE_CONTROL}>:SDL2_net::SDL2_net>"
|
||||
"$<$<BOOL:${BUILD_REMOTE_CONTROL}>:OpenSSL::SSL>"
|
||||
"$<$<BOOL:${BUILD_REMOTE_CONTROL}>:OpenSSL::Crypto>"
|
||||
@@ -718,11 +774,7 @@ endif()
|
||||
|
||||
if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||
INSTALL(FILES $<TARGET_PDB_FILE:soh> DESTINATION ./debug COMPONENT ship)
|
||||
INSTALL(FILES ${CMAKE_BINARY_DIR}/soh/soh.otr DESTINATION . COMPONENT ship)
|
||||
endif()
|
||||
|
||||
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)
|
||||
INSTALL(FILES ${CMAKE_BINARY_DIR}/soh/soh.o2r DESTINATION . COMPONENT ship)
|
||||
endif()
|
||||
|
||||
find_program(CURL NAMES curl DOC "Path to the curl program. Used to download files.")
|
||||
@@ -732,7 +784,7 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
|
||||
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/macosx/Info.plist.in ${CMAKE_BINARY_DIR}/macosx/Info.plist @ONLY)
|
||||
INSTALL(TARGETS soh DESTINATION ../MacOS COMPONENT ship)
|
||||
INSTALL(FILES ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt DESTINATION ../MacOS COMPONENT ship)
|
||||
INSTALL(FILES ${CMAKE_BINARY_DIR}/soh/soh.otr DESTINATION ../Resources COMPONENT ship)
|
||||
INSTALL(FILES ${CMAKE_BINARY_DIR}/soh/soh.o2r DESTINATION ../Resources COMPONENT ship)
|
||||
elseif(NOT "${CMAKE_SYSTEM_NAME}" MATCHES "NintendoSwitch|CafeOS")
|
||||
INSTALL(FILES ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt DESTINATION . COMPONENT ship)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user