diff --git a/CHANGES b/CHANGES index ab91f9bc4..9c2dc22cd 100644 --- a/CHANGES +++ b/CHANGES @@ -22,6 +22,7 @@ Emulation fixes: - GBA Video: Fix Hblank timing - GBA Video: Fix mosaic objects drawing past the end (fixes mgba.io/i/1702) Other fixes: + - CMake: Always use devkitPro toolchain when applicable (fixes mgba.io/i/1755) - Core: Ensure ELF regions can be written before trying - Core: Fix ELF loading regression (fixes mgba.io/i/1669) - Core: Fix crash modifying hash table entry (fixes mgba.io/i/1673) diff --git a/src/platform/3ds/CMakeLists.txt b/src/platform/3ds/CMakeLists.txt index bf5364085..b077ca53a 100644 --- a/src/platform/3ds/CMakeLists.txt +++ b/src/platform/3ds/CMakeLists.txt @@ -7,7 +7,7 @@ find_program(BANNERTOOL bannertool) find_program(MAKEROM makerom) find_program(PICASSO picasso) find_program(RAW2C raw2c) -find_program(STRIP ${cross_prefix}strip) +set(STRIP "${cross_prefix_path}strip" CACHE INTERNAL "symbol stripper") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-format" PARENT_SCOPE) set(OS_DEFINES COLOR_16_BIT COLOR_5_6_5 IOAPI_NO_64) diff --git a/src/platform/cmake/devkitPro.cmake b/src/platform/cmake/devkitPro.cmake index 23f20cc28..df4f950c7 100644 --- a/src/platform/cmake/devkitPro.cmake +++ b/src/platform/cmake/devkitPro.cmake @@ -14,18 +14,20 @@ function(create_devkit DEVKIT) endif() set(CMAKE_PROGRAM_PATH ${DEVKIT${DEVKIT}}/bin CACHE INTERNAL "program path") + set(cross_prefix_path "${CMAKE_PROGRAM_PATH}/${cross_prefix}") + set(cross_prefix_path "${cross_prefix_path}" PARENT_SCOPE) set(extension) if (CMAKE_HOST_WIN32) set(extension .exe) endif() - find_program(CMAKE_AR ${cross_prefix}gcc-ar${extension}) - find_program(CMAKE_RANLIB ${cross_prefix}gcc-ranlib${extension}) - find_program(CMAKE_C_COMPILER ${cross_prefix}gcc${extension}) - find_program(CMAKE_CXX_COMPILER ${cross_prefix}g++${extension}) - find_program(CMAKE_ASM_COMPILER ${cross_prefix}gcc${extension}) - find_program(CMAKE_LINKER ${cross_prefix}ld${extension}) + set(CMAKE_AR "${cross_prefix_path}gcc-ar${extension}" CACHE INTERNAL "archiver") + set(CMAKE_RANLIB "${cross_prefix_path}gcc-ranlib${extension}" CACHE INTERNAL "archiver") + set(CMAKE_C_COMPILER "${cross_prefix_path}gcc${extension}" CACHE INTERNAL "c compiler") + set(CMAKE_CXX_COMPILER "${cross_prefix_path}g++${extension}" CACHE INTERNAL "cxx compiler") + set(CMAKE_ASM_COMPILER "${cross_prefix_path}gcc${extension}" CACHE INTERNAL "assembler") + set(CMAKE_LINKER "${cross_prefix_path}ld${extension}" CACHE INTERNAL "linker") set(CMAKE_C_FLAGS ${inc_flags} CACHE INTERNAL "c compiler flags") set(CMAKE_ASM_FLAGS ${inc_flags} CACHE INTERNAL "assembler flags") set(CMAKE_CXX_FLAGS ${inc_flags} CACHE INTERNAL "cxx compiler flags")