From 329e8be825a80b72ecc3e680587d78e1bce351b0 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Thu, 12 Oct 2017 00:34:40 -0500 Subject: [PATCH] Add IDE switch to CMake options, Add charset.png to dist --- CMakeLists.txt | 11 +++++++---- scripts/build_rom.sh | 1 + scripts/setup_build | 3 ++- src/nostalgia/CMakeLists.txt | 4 ++-- src/nostalgia/core/CMakeLists.txt | 6 +++--- src/nostalgia/core/studio/CMakeLists.txt | 17 ++++++++++++++--- .../studio/charset.png} | Bin 2048 -> 1250 bytes src/nostalgia/player/CMakeLists.txt | 12 +++++++++++- src/nostalgia/studio/CMakeLists.txt | 1 - 9 files changed, 40 insertions(+), 15 deletions(-) rename src/nostalgia/{studio/nostalgia_rom.oxfs => core/studio/charset.png} (58%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 755df3cd..a076cb75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,12 +2,13 @@ cmake_minimum_required(VERSION 2.8.8) project(nostalgia) -set(WOMBAT_BUILD_TYPE "Native" CACHE STRING "The type of build to produce(Native/GBA)") +set(NOSTALGIA_BUILD_TYPE "Native" CACHE STRING "The type of build to produce(Native/GBA)") +set(NOSTALGIA_IDE_BUILD "ON" CACHE STRING "Build for IDE's to run") list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) include(address_sanitizer) -if (WOMBAT_BUILD_TYPE STREQUAL "GBA") +if(NOSTALGIA_BUILD_TYPE STREQUAL "GBA") include(GBA) add_definitions( -nostdlib @@ -22,8 +23,10 @@ add_definitions( -Wsign-compare ) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) +if(NOSTALGIA_IDE_BUILD STREQUAL "ON") + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) +endif() set(CMAKE_INSTALL_RPATH "$ORIGIN" "$ORIGIN/../lib/nostalgia") set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) diff --git a/scripts/build_rom.sh b/scripts/build_rom.sh index 9d7f8c50..bf4a6d2b 100755 --- a/scripts/build_rom.sh +++ b/scripts/build_rom.sh @@ -9,4 +9,5 @@ echo NOSTALGIA_MEDIA_HEADER_________ > media_header.txt ${DEVKITARM}/bin/padbin 32 build/gba-release/nostalgia.bin cat build/gba-release/nostalgia.bin media_header.txt nostalgia_media.oxfs > nostalgia.gba +rm -f media_header.txt ${DEVKITARM}/bin/gbafix nostalgia.gba diff --git a/scripts/setup_build b/scripts/setup_build index 6716244b..6ffcfbc0 100755 --- a/scripts/setup_build +++ b/scripts/setup_build @@ -10,7 +10,7 @@ BUILD_TYPE=$2 if [[ $TARGET == windows ]]; then toolchain="-DCMAKE_TOOLCHAIN_FILE=cmake/Modules/Mingw.cmake" elif [[ $TARGET == gba ]]; then - toolchain="-DCMAKE_TOOLCHAIN_FILE=cmake/Modules/GBA.cmake -DWOMBAT_BUILD_TYPE=GBA -DOX_USE_STDLIB=OFF" + toolchain="-DCMAKE_TOOLCHAIN_FILE=cmake/Modules/GBA.cmake -DNOSTALGIA_BUILD_TYPE=GBA -DOX_USE_STDLIB=OFF" fi if [[ $BUILD_TYPE == debug ]]; then @@ -27,6 +27,7 @@ pushd $buildDir cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_INSTALL_PREFIX="$distDir" \ -DCMAKE_INSTALL_RPATH="$project/dist/${TARGET}-${BUILD_TYPE}/lib/nostalgia" \ + -DNOSTALGIA_IDE_BUILD=OFF \ $buildTypeArgs \ $toolchain \ $project diff --git a/src/nostalgia/CMakeLists.txt b/src/nostalgia/CMakeLists.txt index 3d786d71..85235145 100644 --- a/src/nostalgia/CMakeLists.txt +++ b/src/nostalgia/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8.11) #setup libraries -if(NOT WOMBAT_BUILD_TYPE STREQUAL "GBA") +if(NOT NOSTALGIA_BUILD_TYPE STREQUAL "GBA") find_package(Qt5Widgets) endif() @@ -12,7 +12,7 @@ add_subdirectory(core) add_subdirectory(common) add_subdirectory(player) -if(NOT WOMBAT_BUILD_TYPE STREQUAL "GBA") +if(NOT NOSTALGIA_BUILD_TYPE STREQUAL "GBA") add_subdirectory(tools) add_subdirectory(studio) endif() diff --git a/src/nostalgia/core/CMakeLists.txt b/src/nostalgia/core/CMakeLists.txt index c1fc78e7..9439d4c0 100644 --- a/src/nostalgia/core/CMakeLists.txt +++ b/src/nostalgia/core/CMakeLists.txt @@ -1,13 +1,13 @@ cmake_minimum_required(VERSION 2.8.11) -if(WOMBAT_BUILD_TYPE STREQUAL "GBA") +if(NOSTALGIA_BUILD_TYPE STREQUAL "GBA") enable_language(C ASM) set( CPP gba/gfx.cpp gba/media.cpp ) -elseif(WOMBAT_BUILD_TYPE STREQUAL "Native") +elseif(NOSTALGIA_BUILD_TYPE STREQUAL "Native") set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -23,7 +23,7 @@ add_library( core.cpp ) -if(WOMBAT_BUILD_TYPE STREQUAL "Native") +if(NOSTALGIA_BUILD_TYPE STREQUAL "Native") add_subdirectory(studio) endif() diff --git a/src/nostalgia/core/studio/CMakeLists.txt b/src/nostalgia/core/studio/CMakeLists.txt index ebae071f..461bed3a 100644 --- a/src/nostalgia/core/studio/CMakeLists.txt +++ b/src/nostalgia/core/studio/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.8.11) -if(WOMBAT_BUILD_TYPE STREQUAL "Native") +if(NOSTALGIA_BUILD_TYPE STREQUAL "Native") add_library( NostalgiaCore-Studio SHARED import_tilesheet_wizard.cpp @@ -17,5 +17,16 @@ target_link_libraries( OxStd ) -install(TARGETS NostalgiaCore-Studio - LIBRARY DESTINATION lib/nostalgia) +install( + TARGETS + NostalgiaCore-Studio + LIBRARY DESTINATION + lib/nostalgia +) + +install( + FILES + charset.png + DESTINATION + share/core +) diff --git a/src/nostalgia/studio/nostalgia_rom.oxfs b/src/nostalgia/core/studio/charset.png similarity index 58% rename from src/nostalgia/studio/nostalgia_rom.oxfs rename to src/nostalgia/core/studio/charset.png index b83a56e492fb81d2f9792db4fda7ba7af73c893d..20bae7eb0351ee1e4636e7df76c122a3047a5b19 100644 GIT binary patch delta 9 QcmZn=c*MCmn(+|}01_huaR2}S delta 682 zcmaFF*&raw%D}|Hz`?+9jFo{wfPsO*j*)?(e)2{}5k?RhY7P>+1H{rm3{(jQOdtVH zph96F4Wt;(yf%6A8%T#_=A;H^q^6b>1NExa*F%+o%m66^0T|7|_f&SzA=x)yHO{>D zIv39805TI~xdf1gnFqEIBnUI1<|#wVp*`!KIA