mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-19 21:13:12 -07:00
Temporarily use local Switch Toolchain File
This commit is contained in:
parent
626937fb20
commit
0df3ba69cd
3 changed files with 18 additions and 3 deletions
|
@ -41,8 +41,6 @@ if(CHIAKI_ENABLE_SWITCH AND CHIAKI_ENABLE_SWITCH_LINUX)
|
||||||
set(CMAKE_BUILD_TYPE Debug)
|
set(CMAKE_BUILD_TYPE Debug)
|
||||||
elseif(CHIAKI_ENABLE_SWITCH)
|
elseif(CHIAKI_ENABLE_SWITCH)
|
||||||
add_definitions(-D__SWITCH__)
|
add_definitions(-D__SWITCH__)
|
||||||
# load switch.cmake toolchain form ./cmake folder
|
|
||||||
include(switch)
|
|
||||||
# TODO check if android ... or other versions are enabled
|
# TODO check if android ... or other versions are enabled
|
||||||
# force mbedtls as crypto lib
|
# force mbedtls as crypto lib
|
||||||
set(CHIAKI_LIB_ENABLE_MBEDTLS ON)
|
set(CHIAKI_LIB_ENABLE_MBEDTLS ON)
|
||||||
|
|
|
@ -45,6 +45,23 @@ switchvar(CMAKE_CPP_FLAGS CPPFLAGS "-D__SWITCH__ -I${PORTLIBS_PREFIX}/include -i
|
||||||
switchvar(CMAKE_LD_FLAGS LDFLAGS "${ARCH} -L${PORTLIBS_PREFIX}/lib -L${DEVKITPRO}/libnx/lib")
|
switchvar(CMAKE_LD_FLAGS LDFLAGS "${ARCH} -L${PORTLIBS_PREFIX}/lib -L${DEVKITPRO}/libnx/lib")
|
||||||
switchvar(LIBS LIBS "-lnx")
|
switchvar(LIBS LIBS "-lnx")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# cache flags
|
||||||
|
set( CMAKE_CXX_FLAGS "" CACHE STRING "c++ flags" )
|
||||||
|
set( CMAKE_C_FLAGS "" CACHE STRING "c flags" )
|
||||||
|
set( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "c++ Release flags" )
|
||||||
|
set( CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" CACHE STRING "c Release flags" )
|
||||||
|
set( CMAKE_CXX_FLAGS_DEBUG "-O0 -g -DDEBUG -D_DEBUG" CACHE STRING "c++ Debug flags" )
|
||||||
|
set( CMAKE_C_FLAGS_DEBUG "-O0 -g -DDEBUG -D_DEBUG" CACHE STRING "c Debug flags" )
|
||||||
|
set( CMAKE_SHARED_LINKER_FLAGS "" CACHE STRING "shared linker flags" )
|
||||||
|
set( CMAKE_MODULE_LINKER_FLAGS "" CACHE STRING "module linker flags" )
|
||||||
|
set( CMAKE_EXE_LINKER_FLAGS "-mtp=soft -fPIE -L${DEVKITPRO}/portlibs/switch/lib -L${DEVKITPRO}/libnx/lib -specs=${DEVKITPRO}/libnx/switch.specs -g" CACHE STRING "executable linker flags" )
|
||||||
|
|
||||||
|
# we require the relocation table
|
||||||
|
set(CMAKE_C_FLAGS "-I/opt/devkitpro/libnx/include -D__SWITCH__ -march=armv8-a -mtune=cortex-a57 -mtp=soft -ffunction-sections -fdata-sections -fPIE")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fno-rtti")
|
||||||
|
|
||||||
# switchvar(CMAKE_CXX_FLAGS CXXFLAGS "${CMAKE_C_FLAGS} -fno-rtti")
|
# switchvar(CMAKE_CXX_FLAGS CXXFLAGS "${CMAKE_C_FLAGS} -fno-rtti")
|
||||||
include_directories(${DEVKITPRO}/libnx/include ${PORTLIBS_PREFIX}/include)
|
include_directories(${DEVKITPRO}/libnx/include ${PORTLIBS_PREFIX}/include)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ build="./build"
|
||||||
if [ "$arg1" != "linux" ]; then
|
if [ "$arg1" != "linux" ]; then
|
||||||
CHIAKI_ENABLE_SWITCH_LINUX="OFF"
|
CHIAKI_ENABLE_SWITCH_LINUX="OFF"
|
||||||
source /opt/devkitpro/switchvars.sh
|
source /opt/devkitpro/switchvars.sh
|
||||||
toolchain=/opt/devkitpro/switch.cmake
|
toolchain=../cmake/switch.cmake # TODO: devkitpro ships a toolchain in /opt/devkitpro/switch.cmake, but it's broken.
|
||||||
|
|
||||||
export CC=${TOOL_PREFIX}gcc
|
export CC=${TOOL_PREFIX}gcc
|
||||||
export CXX=${TOOL_PREFIX}g++
|
export CXX=${TOOL_PREFIX}g++
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue