[gbabuildcore] Move GBA cmake files to gbabuildcore

This commit is contained in:
Gary Talent 2021-04-03 02:40:57 -05:00
parent 6265c6dc3b
commit b93d86be8e
4 changed files with 20 additions and 31 deletions

View File

@ -4,50 +4,25 @@ set(CMAKE_POLICY_DEFAULT_CMP0110 NEW) # requires CMake 3.19
project(nostalgia) project(nostalgia)
include(deps/buildcore/base.cmake) include(deps/buildcore/base.cmake)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
set(NOSTALGIA_BUILD_PLAYER ON CACHE BOOL "Build Player") set(NOSTALGIA_BUILD_PLAYER ON CACHE BOOL "Build Player")
set(NOSTALGIA_BUILD_STUDIO ON CACHE BOOL "Build Studio") set(NOSTALGIA_BUILD_STUDIO ON CACHE BOOL "Build Studio")
set(OX_ENABLE_TRACEHOOK OFF CACHE BOOL "Generate OxTraceHook shared library for uprobes") set(OX_ENABLE_TRACEHOOK OFF CACHE BOOL "Generate OxTraceHook shared library for uprobes")
if(BUILDCORE_TARGET STREQUAL "gba") if(BUILDCORE_TARGET STREQUAL "gba")
set(NOSTALGIA_BUILD_STUDIO OFF)
set(NOSTALGIA_BUILD_TYPE "GBA") set(NOSTALGIA_BUILD_TYPE "GBA")
include(deps/gbabuildcore/base.cmake)
else() else()
set(NOSTALGIA_BUILD_TYPE "Native") set(NOSTALGIA_BUILD_TYPE "Native")
endif()
if(NOSTALGIA_BUILD_TYPE STREQUAL "GBA")
set(OX_BARE_METAL ON)
else()
set(NOSTALGIA_CONAN_PATHS ${CMAKE_SOURCE_DIR}/.conanbuild/conan_paths.cmake) set(NOSTALGIA_CONAN_PATHS ${CMAKE_SOURCE_DIR}/.conanbuild/conan_paths.cmake)
if(NOT NOSTALGIA_BUILD_TYPE STREQUAL "GBA" AND EXISTS ${NOSTALGIA_CONAN_PATHS}) if(EXISTS ${NOSTALGIA_CONAN_PATHS})
include(${NOSTALGIA_CONAN_PATHS}) include(${NOSTALGIA_CONAN_PATHS})
endif() endif()
endif()
if(OX_BARE_METAL)
set(NOSTALGIA_BUILD_STUDIO OFF)
set(OX_USE_STDLIB OFF)
else()
add_definitions(-DOX_USE_STDLIB)
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QTDIR}) set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QTDIR})
endif() endif()
if(NOSTALGIA_BUILD_TYPE STREQUAL "GBA")
include(GBA)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdlib")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdinc++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-unwind-tables")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthumb-interwork")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthumb")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=arm7tdmi")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=arm7tdmi")
endif()
if(APPLE) if(APPLE)
set(CMAKE_MACOSX_RPATH OFF) set(CMAKE_MACOSX_RPATH OFF)
set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Library/nostalgia") set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Library/nostalgia")
@ -71,7 +46,7 @@ endif()
add_subdirectory(deps/ox) add_subdirectory(deps/ox)
include_directories(SYSTEM deps/ox/src) include_directories(SYSTEM deps/ox/src)
if(NOSTALGIA_BUILD_TYPE STREQUAL "GBA") if(BUILDCORE_TARGET STREQUAL "gba")
add_subdirectory(deps/gbastartup) add_subdirectory(deps/gbastartup)
elseif(NOSTALGIA_BUILD_STUDIO) elseif(NOSTALGIA_BUILD_STUDIO)
add_subdirectory(deps/QDark) add_subdirectory(deps/QDark)

View File

@ -34,8 +34,8 @@ debug-studio: install
.PHONY: configure-gba .PHONY: configure-gba
configure-gba: configure-gba:
${ENV_RUN} ${SETUP_BUILD} --toolchain=cmake/modules/GBA.cmake --target=gba --current_build=0 --build_type=release ${ENV_RUN} ${SETUP_BUILD} --toolchain=deps/gbabuildcore/cmake/modules/GBA.cmake --target=gba --current_build=0 --build_type=release
.PHONY: configure-gba-debug .PHONY: configure-gba-debug
configure-gba-debug: configure-gba-debug:
${ENV_RUN} ${SETUP_BUILD} --toolchain=cmake/modules/GBA.cmake --target=gba --current_build=0 --build_type=debug ${ENV_RUN} ${SETUP_BUILD} --toolchain=deps/gbabuildcore/cmake/modules/GBA.cmake --target=gba --current_build=0 --build_type=debug

14
deps/gbabuildcore/base.cmake vendored Normal file
View File

@ -0,0 +1,14 @@
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake/modules)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdlib")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -nostdinc++")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-unwind-tables")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthumb-interwork")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthumb")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=arm7tdmi")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=arm7tdmi")
set(OX_BARE_METAL ON)
set(OX_USE_STDLIB OFF)