Skip to content

Commit 7ef8808

Browse files
committed
CMake Cleanup
- Bump cmake_minimum_required to fix warning spam (we already require the higher version in spots anyways) - Remove a bunch of redundant file paths since we require 3.13+ - Only build nuspacking code when we need it (on console)
1 parent 3eb1b48 commit 7ef8808

16 files changed

Lines changed: 41 additions & 159 deletions

File tree

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.7)
1+
cmake_minimum_required(VERSION 3.13)
22

33
set(CMAKE_CXX_STANDARD 20)
44
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -114,14 +114,14 @@ add_subdirectory("command")
114114
add_subdirectory("filetypes")
115115
add_subdirectory("seedgen")
116116
add_subdirectory("logic")
117-
add_subdirectory("nuspack")
118117
add_subdirectory("customizer")
119118

120119
target_include_directories(wwhd_rando PRIVATE ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
121120

122121
if(DEFINED DEVKITPRO)
123122
# Some code specific to Wii U
124123
add_subdirectory("platform")
124+
add_subdirectory("nuspack")
125125
add_subdirectory("gui/wiiu")
126126

127127
# Use libmocha for filesystem access

command/CMakeLists.txt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
cmake_minimum_required(VERSION 3.7)
2-
if(CMAKE_VERSION VERSION_LESS "3.13")
3-
if (POLICY CMP0076)
4-
cmake_policy(SET CMP0076 OLD)
5-
endif()
6-
target_sources(wwhd_rando PRIVATE "command/Log.cpp" "command/WWHDStructs.cpp" "command/RandoSession.cpp" "command/WriteLocations.cpp" "command/WriteEntrances.cpp" "command/WriteCharts.cpp")
7-
else()
8-
cmake_policy(SET CMP0076 NEW)
9-
target_sources(wwhd_rando PRIVATE Log.cpp WWHDStructs.cpp RandoSession.cpp WriteLocations.cpp WriteEntrances.cpp WriteCharts.cpp)
10-
endif()
1+
cmake_minimum_required(VERSION 3.13)
2+
3+
target_sources(wwhd_rando PRIVATE Log.cpp WWHDStructs.cpp RandoSession.cpp WriteLocations.cpp WriteEntrances.cpp WriteCharts.cpp)

customizer/CMakeLists.txt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
cmake_minimum_required(VERSION 3.7)
2-
if(CMAKE_VERSION VERSION_LESS "3.13")
3-
if (POLICY CMP0076)
4-
cmake_policy(SET CMP0076 OLD)
5-
endif()
6-
target_sources(wwhd_rando PRIVATE "customizer/model.cpp")
7-
else()
8-
cmake_policy(SET CMP0076 NEW)
9-
target_sources(wwhd_rando PRIVATE model.cpp)
10-
endif()
1+
cmake_minimum_required(VERSION 3.13)
2+
3+
target_sources(wwhd_rando PRIVATE model.cpp)

filetypes/CMakeLists.txt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
1-
cmake_minimum_required(VERSION 3.7)
2-
if(CMAKE_VERSION VERSION_LESS "3.13")
3-
if (POLICY CMP0076)
4-
cmake_policy(SET CMP0076 OLD)
5-
endif()
6-
target_sources(wwhd_rando PRIVATE "filetypes/wiiurpx.cpp" "filetypes/yaz0.cpp" "filetypes/sarc.cpp" "filetypes/msbt.cpp" "filetypes/elf.cpp" "filetypes/events.cpp" "filetypes/bfres.cpp" "filetypes/jpc.cpp" "filetypes/dzx.cpp" "filetypes/charts.cpp" "filetypes/bflyt.cpp" "filetypes/dds.cpp" "filetypes/bflim.cpp" "filetypes/msbp.cpp" "filetypes/bdt.cpp" "filetypes/bffnt.cpp" "filetypes/util/elfUtil.cpp" "filetypes/shared/lms.cpp")
7-
else()
8-
cmake_policy(SET CMP0076 NEW)
9-
target_sources(wwhd_rando PRIVATE wiiurpx.cpp yaz0.cpp sarc.cpp msbt.cpp elf.cpp events.cpp bfres.cpp jpc.cpp dzx.cpp charts.cpp bflyt.cpp dds.cpp bflim.cpp msbp.cpp bdt.cpp bffnt.cpp util/elfUtil.cpp shared/lms.cpp)
10-
endif()
1+
cmake_minimum_required(VERSION 3.13)
2+
3+
target_sources(wwhd_rando PRIVATE wiiurpx.cpp yaz0.cpp sarc.cpp msbt.cpp elf.cpp events.cpp bfres.cpp jpc.cpp dzx.cpp charts.cpp bflyt.cpp dds.cpp bflim.cpp msbp.cpp bdt.cpp bffnt.cpp util/elfUtil.cpp shared/lms.cpp)
114

125
add_subdirectory("texture")
136
add_subdirectory("subfiles")

filetypes/subfiles/CMakeLists.txt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
cmake_minimum_required(VERSION 3.7)
2-
if(CMAKE_VERSION VERSION_LESS "3.13")
3-
if (POLICY CMP0076)
4-
cmake_policy(SET CMP0076 OLD)
5-
endif()
6-
target_sources(wwhd_rando PRIVATE "filetypes/subfiles/bftex.cpp")
7-
else()
8-
cmake_policy(SET CMP0076 NEW)
9-
target_sources(wwhd_rando PRIVATE bftex.cpp)
10-
endif()
1+
cmake_minimum_required(VERSION 3.13)
2+
3+
target_sources(wwhd_rando PRIVATE bftex.cpp)

filetypes/texture/CMakeLists.txt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
cmake_minimum_required(VERSION 3.7)
2-
if(CMAKE_VERSION VERSION_LESS "3.13")
3-
if (POLICY CMP0076)
4-
cmake_policy(SET CMP0076 OLD)
5-
endif()
6-
target_sources(wwhd_rando PRIVATE "filetypes/texture/addrlib.cpp" "filetypes/texture/formconv.cpp")
7-
else()
8-
cmake_policy(SET CMP0076 NEW)
9-
target_sources(wwhd_rando PRIVATE addrlib.cpp formconv.cpp)
10-
endif()
1+
cmake_minimum_required(VERSION 3.13)
2+
3+
target_sources(wwhd_rando PRIVATE addrlib.cpp formconv.cpp)

logic/CMakeLists.txt

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
cmake_minimum_required(VERSION 3.7)
2-
if(CMAKE_VERSION VERSION_LESS "3.13")
3-
if (POLICY CMP0076)
4-
cmake_policy(SET CMP0076 OLD)
5-
endif()
6-
target_sources(wwhd_rando PRIVATE "logic/GameItem.cpp" "logic/Location.cpp" "logic/World.cpp" "logic/ItemPool.cpp" "logic/Area.cpp" "logic/Fill.cpp" "logic/Search.cpp" "logic/SpoilerLog.cpp" "logic/Dungeon.cpp" "logic/Generate.cpp" "logic/Requirements.cpp" "logic/Entrance.cpp" "logic/EntranceShuffle.cpp" "logic/LogicTests.cpp" "logic/Hints.cpp" "logic/Plandomizer.cpp")
7-
else()
8-
cmake_policy(SET CMP0076 NEW)
9-
target_sources(wwhd_rando PRIVATE GameItem.cpp Location.cpp World.cpp ItemPool.cpp Area.cpp Fill.cpp Search.cpp SpoilerLog.cpp Dungeon.cpp Generate.cpp Requirements.cpp Entrance.cpp EntranceShuffle.cpp LogicTests.cpp Hints.cpp Plandomizer.cpp)
10-
endif()
1+
cmake_minimum_required(VERSION 3.13)
112

12-
add_subdirectory("flatten")
3+
target_sources(wwhd_rando PRIVATE GameItem.cpp Location.cpp World.cpp ItemPool.cpp Area.cpp Fill.cpp Search.cpp SpoilerLog.cpp Dungeon.cpp Generate.cpp Requirements.cpp Entrance.cpp EntranceShuffle.cpp LogicTests.cpp Hints.cpp Plandomizer.cpp)
4+
5+
add_subdirectory("flatten")

logic/flatten/CMakeLists.txt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
cmake_minimum_required(VERSION 3.7)
2-
if(CMAKE_VERSION VERSION_LESS "3.13")
3-
if (POLICY CMP0076)
4-
cmake_policy(SET CMP0076 OLD)
5-
endif()
6-
target_sources(wwhd_rando PRIVATE "logic/flatten/bits.cpp" "logic/flatten/simplify_algebraic.cpp" "logic/flatten/flatten.cpp")
7-
else()
8-
cmake_policy(SET CMP0076 NEW)
9-
target_sources(wwhd_rando PRIVATE bits.cpp simplify_algebraic.cpp flatten.cpp)
10-
endif()
1+
cmake_minimum_required(VERSION 3.13)
2+
3+
target_sources(wwhd_rando PRIVATE bits.cpp simplify_algebraic.cpp flatten.cpp)

nuspack/CMakeLists.txt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
1-
cmake_minimum_required(VERSION 3.7)
2-
if(CMAKE_VERSION VERSION_LESS "3.13")
3-
if (POLICY CMP0076)
4-
cmake_policy(SET CMP0076 OLD)
5-
endif()
6-
7-
target_sources(wwhd_rando PRIVATE nuspack/packer.cpp nuspack/appinfo.cpp)
8-
else()
9-
cmake_policy(SET CMP0076 NEW)
1+
cmake_minimum_required(VERSION 3.13)
102

11-
target_sources(wwhd_rando PRIVATE packer.cpp appinfo.cpp)
12-
endif()
3+
target_sources(wwhd_rando PRIVATE packer.cpp appinfo.cpp)
134

145
add_subdirectory("packaging")
156
add_subdirectory("fst")

nuspack/contents/CMakeLists.txt

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
cmake_minimum_required(VERSION 3.7)
2-
if(CMAKE_VERSION VERSION_LESS "3.13")
3-
if (POLICY CMP0076)
4-
cmake_policy(SET CMP0076 OLD)
5-
endif()
6-
7-
target_sources(wwhd_rando PRIVATE nuspack/contents/contentInfo.cpp nuspack/contents/contents.cpp)
8-
else()
9-
cmake_policy(SET CMP0076 NEW)
1+
cmake_minimum_required(VERSION 3.13)
102

11-
target_sources(wwhd_rando PRIVATE contentInfo.cpp contents.cpp)
12-
endif()
3+
target_sources(wwhd_rando PRIVATE contentInfo.cpp contents.cpp)

0 commit comments

Comments
 (0)