Closed roytam1 closed 4 months ago
You should be using the CMakeToolchain.txt file instead of specifying all the paths manually. See this for an example invocation: https://buildbot.mgba.io/api/v2/logs/31208/raw
You should be using the CMakeToolchain.txt file instead of specifying all the paths manually.
So I used this to create makefiles:
cmake -G "MSYS Makefiles" -DCMAKE_TOOLCHAIN_FILE=src/platform/3ds/CMakeToolchain.txt
but where to put citro3d include/lib path? Now I got this:
[ 94%] Building C object 3ds/CMakeFiles/mgba.elf.dir/gui-font.c.obj
In file included from d:/Test/_3DS/mgba/src/platform/3ds/gui-font.c:12:0:
d:/Test/_3DS/mgba/src/platform/3ds/ctr-gpu.h:12:10: fatal error: citro3d.h: No such file or directory
#include <citro3d.h>
^~~~~~~~~~~
compilation terminated.
make[2]: *** [3ds/CMakeFiles/mgba.elf.dir/gui-font.c.obj] Error 1
make[1]: *** [3ds/CMakeFiles/mgba.elf.dir/all] Error 2
make: *** [all] Error 2
anyway I hacked around src/platform/3ds/CMakeToolchain.txt for this:
diff --git a/src/platform/3ds/CMakeToolchain.txt b/src/platform/3ds/CMakeToolchain.txt
index 9b67d301..74bfe35b 100644
--- a/src/platform/3ds/CMakeToolchain.txt
+++ b/src/platform/3ds/CMakeToolchain.txt
@@ -24,8 +24,8 @@ endif()
set(CMAKE_PROGRAM_PATH ${DEVKITARM}/bin)
set(cross_prefix arm-none-eabi-)
set(arch_flags "-march=armv6k -mtune=mpcore -mfpu=vfp -mfloat-abi=hard")
-set(inc_flags "-I${CTRULIB}/include ${arch_flags} -mword-relocations")
-set(link_flags "-L${CTRULIB}/lib -lctru -specs=3dsx.specs ${arch_flags}")
+set(inc_flags "-I${CTRULIB}/include -I${DEVKITPRO}/citro3d/include ${arch_flags} -mword-relocations")
+set(link_flags "-L${CTRULIB}/lib -L${DEVKITPRO}/citro3d/lib -lctru -lcitro3d -specs=3dsx.specs ${arch_flags}")
set(CMAKE_SYSTEM_NAME Generic CACHE INTERNAL "system name")
set(CMAKE_SYSTEM_PROCESSOR arm CACHE INTERNAL "processor")
OK it builds, but when I tried to load a GBA ROM, it crashes.
Closing due to how stale this undoubtedly is. If it still crashes when built on Windows, please open a new bug.
Build Platform: Win7 SP1 x64 devKitPro 1.6.0 devKitPro ARM r47
CMake commandline:
Error: