diff --git a/.github/workflows/build_mac.yml b/.github/workflows/build_mac.yml index 2d2adadc..1b955f6b 100644 --- a/.github/workflows/build_mac.yml +++ b/.github/workflows/build_mac.yml @@ -39,6 +39,7 @@ jobs: uses: actions/checkout@v6 with: submodules: recursive + fetch-depth: 0 fetch-tags: true - name: Install Qt diff --git a/.github/workflows/build_wiiu.yml b/.github/workflows/build_wiiu.yml index ce1d00d8..116557c7 100644 --- a/.github/workflows/build_wiiu.yml +++ b/.github/workflows/build_wiiu.yml @@ -38,6 +38,7 @@ jobs: uses: actions/checkout@v6 with: submodules: recursive + fetch-depth: 0 fetch-tags: true - name: Set Debug Flags diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index fa1e005f..c72bc2cc 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -48,6 +48,7 @@ jobs: uses: actions/checkout@v6 with: submodules: recursive + fetch-depth: 0 fetch-tags: true - name: Install Qt diff --git a/CMakeLists.txt b/CMakeLists.txt index b8e6c2c2..4fad755b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,15 +4,41 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -project(wwhd_rando VERSION 0.1 LANGUAGES C CXX) # not sure how to handle this version variable, putting it here for the mac bundle +# Versioning +if(DEFINED RELEASE_TAG) + # Use the new tag we're creating for this release (passed in workflow) + set(GIT_TAG "${RELEASE_TAG}") + + # Also use the seed key to change item placement when a spoiler log isn't generated + set(SEED_KEY "$ENV{SEED_KEY}") +else() + # Get previous tag and commit hash + find_package(Git REQUIRED) + execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty --broken + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + OUTPUT_VARIABLE GIT_TAG + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE + ) +endif() +string(REGEX MATCH "^([0-9]+)\\.([0-9]+)\\.([0-9]+)(-([0-9]+))?(-g([0-9a-f]+))?(-([a-z]+))?" VERSION_MATCH "${GIT_TAG}") +if(VERSION_MATCH) + set(PROJECT_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}") + if(${CMAKE_MATCH_5}) + string(APPEND PROJECT_VERSION ".${CMAKE_MATCH_5}") + endif() +else() + set(PROJECT_VERSION "0.0.0.0") +endif() +configure_file(version.hpp.in version.hpp @ONLY) +configure_file(keys/keys.hpp.in keys/keys.hpp @ONLY) + +project(wwhd_rando VERSION ${PROJECT_VERSION} LANGUAGES C CXX) add_compile_options("$<$:/utf-8>") if(DEFINED DEVKITPRO) add_compile_definitions(DEVKITPRO) add_compile_options(-Ofast -mcpu=750 -meabi -mhard-float -ffunction-sections -flto -Wall) add_link_options(-flto -fno-fat-lto-objects) -elseif(APPLE) - add_compile_options(-fexperimental-library) endif() if(ENABLE_DEBUG) @@ -45,24 +71,6 @@ if(LOGIC_TESTS) endif() endif() -# Versioning -if(DEFINED RELEASE_TAG) - # Use the new tag we're creating for this release (passed in workflow) - set(GIT_TAG "${RELEASE_TAG}") - - # Also use the seed key to change item placement when a spoiler log isn't generated - set(SEED_KEY "$ENV{SEED_KEY}") -else() - # Get previous tag and commit hash - find_package(Git REQUIRED) - execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty --broken - WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" - OUTPUT_VARIABLE GIT_TAG - ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE - ) -endif() -configure_file(version.hpp.in version.hpp @ONLY) -configure_file(keys/keys.hpp.in keys/keys.hpp @ONLY) # Path strings for logging string(LENGTH "${CMAKE_SOURCE_DIR}/" SOURCE_PATH_SIZE) @@ -99,14 +107,6 @@ else() add_executable(wwhd_rando main.cpp) endif() -if(GET_THREADS) - find_package(Threads REQUIRED) - - if(CMAKE_USE_PTHREADS_INIT) - target_link_libraries(wwhd_rando PRIVATE Threads::Threads) - endif() -endif() - target_sources(wwhd_rando PRIVATE "randomizer.cpp" "options.cpp" "tweaks.cpp" "text_replacements.cpp") add_subdirectory("libs") add_subdirectory("utility") @@ -140,4 +140,7 @@ if(DEFINED DEVKITPRO) #TVSPLASH "${CMAKE_SOURCE_DIR}/platform/Splash.png" #DRCSPLASH "${CMAKE_SOURCE_DIR}/platform/Splash.png" ) +else() + find_package(Threads REQUIRED) + target_link_libraries(wwhd_rando PRIVATE Threads::Threads) endif() diff --git a/gui/desktop/CMakeLists.txt b/gui/desktop/CMakeLists.txt index 456f9d3c..71f94101 100644 --- a/gui/desktop/CMakeLists.txt +++ b/gui/desktop/CMakeLists.txt @@ -40,9 +40,11 @@ target_sources(wwhd_rando PRIVATE mainwindow.cpp mainwindow.ui player_customizat target_link_libraries(wwhd_rando PRIVATE Qt${QT_VERSION_MAJOR}::Widgets) set_target_properties(wwhd_rando PROPERTIES - MACOSX_BUNDLE_wwhd_rando_IDENTIFIER my.example.com + MACOSX_BUNDLE_BUNDLE_NAME "WWHD Randomizer" # 15 character limit + MACOSX_BUNDLE_GUI_IDENTIFIER "com.github.superdude88.twwhd-randomizer" + MACOSX_BUNDLE_COPYRIGHT "Copyright (c) 2024 TWWHDR Contributors" MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} - MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} + MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} MACOSX_BUNDLE TRUE WIN32_EXECUTABLE TRUE )