diff --git a/.gitmodules b/.gitmodules index b787f018..fc00b1fa 100644 --- a/.gitmodules +++ b/.gitmodules @@ -14,6 +14,14 @@ path = lib/NintendoSDK url = https://github.com/open-ead/nnheaders branch = master +[submodule "lib/nnsdk"] + path = lib/nnsdk + url = https://github.com/open-ead/nnsdk + branch = main +[submodule "lib/nnware"] + path = lib/nnware + url = https://github.com/open-ead/nnware + branch = main [submodule "lib/agl"] path = lib/agl url = https://github.com/open-ead/agl diff --git a/CMakeLists.txt b/CMakeLists.txt index 3868a040..e85fd8e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,8 @@ -cmake_minimum_required(VERSION 3.15) +cmake_minimum_required(VERSION 3.30) project(uking CXX) +set(SEAD_USE_OLD_NNHEADERS_REPO OFF CACHE BOOL "Enable new nnsdk repo") + set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Use response files when linking objects because of the large number of source files set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS ON) @@ -33,8 +35,9 @@ target_compile_options(uking PRIVATE -Wextra-semi) set(NN_SDK 4.4.0) set(NN_WARE 1.6.1) set(NN_SDK_TYPE "Release") -add_subdirectory(lib/NintendoSDK) -target_link_libraries(uking PUBLIC NintendoSDK) +add_subdirectory(lib/nnsdk) +add_subdirectory(lib/nnware) +target_link_libraries(uking PUBLIC $) add_subdirectory(lib/sead) target_link_libraries(uking PUBLIC sead) diff --git a/lib/gsys/CMakeLists.txt b/lib/gsys/CMakeLists.txt index 13947de7..a8391c88 100644 --- a/lib/gsys/CMakeLists.txt +++ b/lib/gsys/CMakeLists.txt @@ -37,3 +37,5 @@ if(NOT TARGET agl) add_subdirectory(../agl) endif() target_link_libraries(gsys PUBLIC agl) + +target_link_libraries(gsys PUBLIC nn_g3d) diff --git a/lib/gsys/include/gsys/gsysModelNW.h b/lib/gsys/include/gsys/gsysModelNW.h index a6da4f27..2133c7b5 100644 --- a/lib/gsys/include/gsys/gsysModelNW.h +++ b/lib/gsys/include/gsys/gsysModelNW.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include #include #include #include diff --git a/lib/gsys/include/gsys/gsysModelUnit.h b/lib/gsys/include/gsys/gsysModelUnit.h index fb48587c..d0b86861 100644 --- a/lib/gsys/include/gsys/gsysModelUnit.h +++ b/lib/gsys/include/gsys/gsysModelUnit.h @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/lib/hkStubs/CMakeLists.txt b/lib/hkStubs/CMakeLists.txt index 2620fa6a..7aeb69a9 100644 --- a/lib/hkStubs/CMakeLists.txt +++ b/lib/hkStubs/CMakeLists.txt @@ -240,7 +240,4 @@ target_compile_options(hkStubs PRIVATE -fno-strict-aliasing) target_compile_options(hkStubs PRIVATE -Wno-invalid-offsetof) target_include_directories(hkStubs PUBLIC ./) -if(NOT TARGET NintendoSDK) - add_subdirectory(../NintendoSDK) -endif() -target_link_libraries(hkStubs PUBLIC NintendoSDK) +target_link_libraries(hkStubs PUBLIC nnSdk) diff --git a/lib/nnsdk b/lib/nnsdk new file mode 160000 index 00000000..02dab889 --- /dev/null +++ b/lib/nnsdk @@ -0,0 +1 @@ +Subproject commit 02dab8893e850d9f9f8d6f28c51491c1bf0d8f66 diff --git a/lib/nnware b/lib/nnware new file mode 160000 index 00000000..8a9e2d24 --- /dev/null +++ b/lib/nnware @@ -0,0 +1 @@ +Subproject commit 8a9e2d24967ae6dacf231aec661e77e2fdf67155 diff --git a/lib/sead b/lib/sead index efc9f222..f4178a21 160000 --- a/lib/sead +++ b/lib/sead @@ -1 +1 @@ -Subproject commit efc9f2226d74b3c79a492981c8fced23e77b0075 +Subproject commit f4178a21e21235830357dc27c26a2c29956972ed diff --git a/src/KingSystem/Physics/Rig/physModelBoneAccessor.cpp b/src/KingSystem/Physics/Rig/physModelBoneAccessor.cpp index 1daaeda4..cb9a5a7b 100644 --- a/src/KingSystem/Physics/Rig/physModelBoneAccessor.cpp +++ b/src/KingSystem/Physics/Rig/physModelBoneAccessor.cpp @@ -6,8 +6,8 @@ #include #include #include -#include -#include +#include +#include #include #include "KingSystem/Physics/physConversions.h" #include "KingSystem/Utils/MathUtil.h" diff --git a/toolchain/ToolchainNX64.cmake b/toolchain/ToolchainNX64.cmake index c518b2db..f3de343f 100644 --- a/toolchain/ToolchainNX64.cmake +++ b/toolchain/ToolchainNX64.cmake @@ -48,3 +48,12 @@ else() # Use lld for performance reasons (and because we don't want a dependency on GNU tools) add_link_options(-fuse-ld=lld) endif() + +set(CMAKE_CXX_LINK_LIBRARY_USING_whole_archive + "LINKER:--whole-archive" "" "LINKER:--no-whole-archive") +set(CMAKE_CXX_LINK_LIBRARY_USING_whole_archive_SUPPORTED TRUE) +# Allow mixing with links of the same library without a feature (requires CMake 3.30) +# This is important because some dependencies in the middle can link a library +# without whole_archive, for example your_project -links-> nn_g3d -links-> nn_gfx +set(CMAKE_LINK_LIBRARY_whole_archive_ATTRIBUTES + LIBRARY_TYPE=STATIC DEDUPLICATION=YES OVERRIDE=DEFAULT)