Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
fetch-tags: true

- name: Install Qt
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_wiiu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
fetch-tags: true

- name: Set Debug Flags
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
uses: actions/checkout@v6
with:
submodules: recursive
fetch-depth: 0
fetch-tags: true

- name: Install Qt
Expand Down
61 changes: 32 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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("$<$<CXX_COMPILER_ID:MSVC>:/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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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()
6 changes: 4 additions & 2 deletions gui/desktop/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
Loading