summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2026-10-11 03:50:14 +0100
committerGitHub <noreply@github.com>2026-10-11 03:50:14 +0100
commitbdf141cf2d4919bb08de69d8a0c6cb4b6dd3e4ef (patch)
tree93dc88146a480f204bd77bf5ee0a7b2d19d25e52
parent08c2d002a66c0ec181345a88690fc1457d32136b (diff)
parent5aac30d758dc7e0d23ab9e44a3b98847054de2f7 (diff)
Merge pull request #210 from Pistonight/lib/migrade_sdk
lib: botw migrate to new nnsdk repo
-rw-r--r--.gitmodules8
-rw-r--r--CMakeLists.txt9
-rw-r--r--lib/gsys/CMakeLists.txt2
-rw-r--r--lib/gsys/include/gsys/gsysModelNW.h2
-rw-r--r--lib/gsys/include/gsys/gsysModelUnit.h2
-rw-r--r--lib/hkStubs/CMakeLists.txt5
m---------lib/nnsdk0
m---------lib/nnware0
m---------lib/sead0
-rw-r--r--src/KingSystem/Physics/Rig/physModelBoneAccessor.cpp4
-rw-r--r--toolchain/ToolchainNX64.cmake9
11 files changed, 30 insertions, 11 deletions
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 $<LINK_LIBRARY:whole_archive,nn_gfx>)
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 <gsys/gsysModelUnit.h>
-#include <nn/g3d/ModelObj.h>
+#include <nn/g3d/g3d_ModelObj.h>
#include <nn/gfx/gfx_MemoryPool.h>
#include <nn/gfx/gfx_Types.h>
#include <prim/seadDelegate.h>
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 <math/seadBoundBox.h>
#include <math/seadMatrix.h>
#include <math/seadVector.h>
-#include <nn/g3d/World.h>
+#include <nn/g3d/g3d_World.h>
#include <prim/seadBitFlag.h>
#include <prim/seadDelegate.h>
#include <prim/seadRuntimeTypeInfo.h>
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
+Subproject 02dab8893e850d9f9f8d6f28c51491c1bf0d8f6
diff --git a/lib/nnware b/lib/nnware
new file mode 160000
+Subproject 8a9e2d24967ae6dacf231aec661e77e2fdf6715
diff --git a/lib/sead b/lib/sead
-Subproject efc9f2226d74b3c79a492981c8fced23e77b007
+Subproject f4178a21e21235830357dc27c26a2c29956972e
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 <gsys/gsysModelNW.h>
#include <heap/seadExpHeap.h>
#include <heap/seadHeapMgr.h>
-#include <nn/g3d/ResSkeleton.h>
-#include <nn/g3d/SkeletonObj.h>
+#include <nn/g3d/g3d_ResSkeleton.h>
+#include <nn/g3d/g3d_SkeletonObj.h>
#include <type_traits>
#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" "<LINK_ITEM>" "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)