Switch build fixes

This commit is contained in:
Phillip Stephens 2018-09-25 15:38:11 -07:00
parent 80c283736e
commit d4278bd52b
3 changed files with 12 additions and 9 deletions

View File

@ -243,11 +243,14 @@ install(EXPORT AthenaTargets DESTINATION ${INSTALL_CMAKE_DIR} COMPONENT athena)
# atdna import # # atdna import #
################ ################
if(NOT GEKKO AND NOT NX)
add_subdirectory(atdna) add_subdirectory(atdna)
# Test target # Test target
atdna(atdna_test.cpp atdna/test.hpp) atdna(atdna_test.cpp atdna/test.hpp)
add_executable(atdna-test atdna/test.cpp atdna_test.cpp atdna/test.hpp) add_executable(atdna-test atdna/test.cpp atdna_test.cpp atdna/test.hpp)
if (CMAKE_SYSTEM_NAME STREQUAL "Switch")
set_target_properties(atdna-test PROPERTIES SUFFIX ".elf")
target_link_libraries(atdna-test athena-core athena-libyaml nx)
else()
target_link_libraries(atdna-test athena-core athena-libyaml) target_link_libraries(atdna-test athena-core athena-libyaml)
endif() endif()

View File

@ -1,7 +1,7 @@
if(NOT WIN32 AND NOT APPLE) if(NOT WIN32 AND NOT APPLE AND NOT NX)
find_library(LZO_LIB lzo2) find_library(LZO_LIB lzo2)
endif() endif()
if(WIN32 OR APPLE OR LZO_LIB STREQUAL LZO_LIB-NOTFOUND) if(WIN32 OR APPLE OR NX OR LZO_LIB STREQUAL LZO_LIB-NOTFOUND)
include_directories(include) include_directories(include)
message(STATUS "Using Athena's built-in lzo") message(STATUS "Using Athena's built-in lzo")
add_library(lzo2 add_library(lzo2
@ -77,7 +77,7 @@ add_library(lzo2
include/lzo/lzoconf.h include/lzo/lzoconf.h
include/lzo/lzodefs.h include/lzo/lzodefs.h
include/lzo/lzoutil.h) include/lzo/lzoutil.h)
if(WIN32 AND NOT UNIX) if(WIN32 AND NOT UNIX AND NOT NX)
install(DIRECTORY include/lzo DESTINATION include COMPONENT lzo2) install(DIRECTORY include/lzo DESTINATION include COMPONENT lzo2)
install(TARGETS lzo2 DESTINATION lib COMPONENT lzo2) install(TARGETS lzo2 DESTINATION lib COMPONENT lzo2)
endif() endif()

View File

@ -31,13 +31,13 @@ endif()
set(PKG_CONFIG "${DEVKITPRO}/portlibs/bin/aarch64-none-elf-pkg-config" CACHE STRING "") set(PKG_CONFIG "${DEVKITPRO}/portlibs/bin/aarch64-none-elf-pkg-config" CACHE STRING "")
set(CPPFLAGS "-D__SWITCH__ -I${DEVKITPRO}/libnx/include -I${DEVKITPRO}/portlibs/switch/include") set(CPPFLAGS "-D__SWITCH__ -I${DEVKITPRO}/libnx/include -I${DEVKITPRO}/portlibs/switch/include")
set(CMAKE_C_FLAGS "${CPPFLAGS} -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIC -ffunction-sections" CACHE STRING "C flags") set(CMAKE_C_FLAGS "${CPPFLAGS} -march=armv8-a -neon -mtune=cortex-a57 -mfpu=neon -mtp=soft -fPIC -ffunction-sections" CACHE STRING "C flags")
set(CMAKE_CXX_FLAGS "${CPPFLAGS} ${CMAKE_C_FLAGS} -fno-rtti -fno-exceptions -std=gnu++11" CACHE STRING "C++ flags") set(CMAKE_CXX_FLAGS "${CPPFLAGS} ${CMAKE_C_FLAGS} -fno-exceptions -std=gnu++11" CACHE STRING "C++ flags")
if(WITH_PORTLIBS) if(WITH_PORTLIBS)
set(CMAKE_FIND_ROOT_PATH ${DEVKITPRO}/devkitA64 ${DEVKITPRO} ${DEVKITPRO}/libnx ${DEVKITPRO}/portlibs/switch) set(CMAKE_FIND_ROOT_PATH / ${DEVKITPRO}/devkitA64 ${DEVKITPRO} ${DEVKITPRO}/libnx ${DEVKITPRO}/portlibs/switch)
else() else()
set(CMAKE_FIND_ROOT_PATH ${DEVKITPRO}/devkitA64 ${DEVKITPRO}/libnx ${DEVKITPRO}) set(CMAKE_FIND_ROOT_PATH / ${DEVKITPRO}/devkitA64 ${DEVKITPRO}/libnx ${DEVKITPRO})
endif() endif()
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)