From 22cd8923ed44d8b4f40ce5495b6197161de03a66 Mon Sep 17 00:00:00 2001 From: Pistonight Date: Sun, 27 Sep 2026 14:44:54 -0700 Subject: [PATCH] build: add nnware migration gate --- CMakeLists.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index b1c6b45..3fd7448 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ project(eui CXX ASM) +# see https://github.com/open-ead/nnheaders/blob/master/MIGRATE.md#phase-2-compatibility-gate-of-open-ead-libraries-sead-and-nintendosdk-nex +option(EUI_USE_OLD_NNHEADERS_REPO "Migration setting for the nnsdk and nnware repo split" ON) + add_library(eui OBJECT include/euiControlBase.h include/message/euiFontMgr.h @@ -21,3 +24,16 @@ if(NOT TARGET agl) add_subdirectory(../agl) endif() target_link_libraries(eui PUBLIC agl sead) + +if(EUI_USE_OLD_NNHEADERS_REPO) + # we are supposed to link old SDK here but eui never did, + # it just depended on other projects to provide the sdk headers + target_compile_definitions(eui PUBLIC EUI_USE_OLD_NNHEADERS_REPO) +else() + message(STATUS "Using new nnware repo! Please see https://github.com/open-ead/nnheaders/blob/master/MIGRATE.md") + message(STATUS "If you do not wish to migrate at this time, put `set(EUI_USE_OLD_NNHEADERS_REPO OFF CACHE BOOL \"Disable nnsdk migration\") in your CMakeLists.txt, or pass -DSEAD_USE_OLD_NNHEADERS_REPO=ON to cmake command") + if(NOT TARGET nn_font) + message(FATAL_ERROR "Cannot find NintendoWare. You need to add open-ead/nnware to your project, and put `add_subdirectory(path/to/nnware)` somewhere in your CMakeLists.txt") + endif() + target_link_libraries(eui PUBLIC nn_font) +endif()