X Tutup
Skip to content

Fixes libretro NSwitch build#2891

Open
imsys wants to merge 1 commit intonesbox:mainfrom
imsys:patch-6
Open

Fixes libretro NSwitch build#2891
imsys wants to merge 1 commit intonesbox:mainfrom
imsys:patch-6

Conversation

@imsys
Copy link
Contributor

@imsys imsys commented Mar 1, 2026

Trying to fix the libretro build, main thread at: libretro#28

by making this change, I was able to compile using this dockerfile:

FROM git.libretro.com:5050/libretro-infrastructure/libretro-build-libnx-devkitpro:v4-10-0

USER root

WORKDIR /wrk

#RUN git clone --recursive https://github.com/nesbox/TIC-80.git core
COPY . core

WORKDIR /wrk/core

RUN git submodule update --init --recursive

ENV CORENAME=tic80
ENV BUILD_DIR=build/libnx
ENV EXTRA_PATH=bin
ENV CMAKE_SOURCE_ROOT=.

ENV CORE_ARGS="-DBUILD_LIBRETRO=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_PLAYER=OFF -DBUILD_PRO=OFF -DBUILD_SDL=OFF -DBUILD_TOOLS=OFF -DBUILD_TOUCH_INPUT=OFF -DBUILD_STATIC=ON  -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DBUILD_WITH_RUBY=OFF -DBUILD_WITH_SCHEME=OFF -DBUILD_WITH_ALL=OFF"


RUN cmake $CORE_ARGS "$CMAKE_SOURCE_ROOT" -B$BUILD_DIR -DCMAKE_BUILD_TYPE=Release -DLIBRETRO_STATIC=ON -DLIBRETRO_SUFFIX=_libnx -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake -DNSWITCH=ON -DCFLAGS=-DHAVE_LIBNX=1 -DCXXFLAGS=-DHAVE_LIBNX=1

RUN cmake --build $BUILD_DIR --target ${CORENAME}_libretro --config Release -- -j $(nproc)

CMD ["/bin/bash"]

@imsys
Copy link
Contributor Author

imsys commented Mar 1, 2026

Previously, the error was this:

1.028 -- The C compiler identification is GNU 15.1.0
1.078 -- The CXX compiler identification is GNU 15.1.0
1.086 -- Detected multilib folder: pic
1.092 -- Detecting C compiler ABI info
1.210 -- Detecting C compiler ABI info - done
1.222 -- Check for working C compiler: /opt/devkitpro/devkitA64/bin/aarch64-none-elf-gcc - skipped
1.223 -- Detecting C compile features
1.223 -- Detecting C compile features - done
1.227 -- Detecting CXX compiler ABI info
1.311 -- Detecting CXX compiler ABI info - done
1.322 -- Check for working CXX compiler: /opt/devkitpro/devkitA64/bin/aarch64-none-elf-g++ - skipped
1.323 -- Detecting CXX compile features
1.323 -- Detecting CXX compile features - done
1.324 Building for target : NintendoSwitch
1.324 PROJECT_VERSION: 1.2.3058-dev
1.324 VERSION_HASH: 3d0acd3
1.324 PREFER_SYSTEM_LIBRARIES: ON
1.324 BUILD_STATIC: ON
1.324 BUILD_SDLGPU: OFF
1.324 BUILD_TOUCH_INPUT: OFF
1.324 BUILD_WITH_ALL: OFF
1.325 -- Use system library: giflib
1.333 -- Found PkgConfig: /opt/devkitpro/portlibs/switch/bin/aarch64-none-elf-pkg-config (found version "1.8.1") 
1.333 -- Checking for module 'zlib'
1.348 --   Found zlib, version 1.3.1
1.386 -- Use system library: zlib
1.387 CMake Warning at cmake/zip.cmake:17 (message):
1.387   System library kubazip not found
1.387 Call Stack (most recent call first):
1.387   CMakeLists.txt:165 (include)
1.387 
1.387 
1.396 -- Checking for module 'libpng'
1.412 --   Found libpng, version 1.6.48
1.452 -- Use system library: libpng
1.452 BUILD_WITH_LUA: ON
1.452 CMake Warning at cmake/lua.cmake:28 (message):
1.452   System library lua not found
1.452 Call Stack (most recent call first):
1.452   CMakeLists.txt:169 (include)
1.452 
1.452 
1.453 BUILD_WITH_MOON: OFF
1.453 BUILD_WITH_YUE: OFF
1.453 BUILD_WITH_FENNEL: OFF
1.453 BUILD_WITH_WREN: OFF
1.453 BUILD_WITH_RUBY: OFF
1.453 BUILD_WITH_WASM: OFF
1.453 BUILD_WITH_SCHEME: OFF
1.453 BUILD_WITH_SQUIRREL: OFF
1.453 BUILD_WITH_PYTHON: OFF
1.454 BUILD_WITH_JS: OFF
1.454 BUILD_WITH_JANET: OFF
1.454 CMake Warning at cmake/argparse.cmake:17 (message):
1.454   System library argparse not found
1.454 Call Stack (most recent call first):
1.454   CMakeLists.txt:184 (include)
1.454 
1.454 
1.455 CMake Warning at cmake/naett.cmake:32 (message):
1.455   System library naett not found
1.455 Call Stack (most recent call first):
1.455   CMakeLists.txt:185 (include)
1.455 
1.455 
1.458 -- Use system library: SDL2
1.458 CMake Error at cmake/nswitch.cmake:14 (target_sources):
1.458   Cannot specify sources for target "tic80" which is not built by this
1.458   project.
1.458 Call Stack (most recent call first):
1.458   CMakeLists.txt:191 (include)
1.458 
1.458 
1.464 -- Checking for one of the modules 'libcurl'
1.518 CMake Error at cmake/nswitch.cmake:19 (target_link_libraries):
1.518   Cannot specify link libraries for target "tic80" which is not built by this
1.518   project.
1.518 Call Stack (most recent call first):
1.518   CMakeLists.txt:191 (include)
1.518 
1.518 
1.519 -- Configuring incomplete, errors occurred!

@imsys imsys mentioned this pull request Mar 9, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

X Tutup