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 b83a56e4..20bae7eb 100644 Binary files a/src/nostalgia/studio/nostalgia_rom.oxfs and b/src/nostalgia/core/studio/charset.png differ diff --git a/src/nostalgia/player/CMakeLists.txt b/src/nostalgia/player/CMakeLists.txt index d1e25608..b4d2bf9e 100644 --- a/src/nostalgia/player/CMakeLists.txt +++ b/src/nostalgia/player/CMakeLists.txt @@ -14,7 +14,7 @@ if(COMMAND OBJCOPY_FILE) COMPILER_FLAGS "-mthumb -mthumb-interwork" ) - OBJCOPY_FILE(../../../nostalgia) + OBJCOPY_FILE(nostalgia) #PADBIN_FILE(nostalgia) endif() @@ -26,6 +26,7 @@ target_link_libraries( ) add_custom_target("nostalgia.bin") + install( TARGETS nostalgia @@ -33,3 +34,12 @@ install( bin ) +if (NOSTALGIA_BUILD_TYPE STREQUAL "GBA") + install( + FILES + nostalgia.bin + DESTINATION + bin + ) +endif() + diff --git a/src/nostalgia/studio/CMakeLists.txt b/src/nostalgia/studio/CMakeLists.txt index 786e0ac8..4df4daf2 100644 --- a/src/nostalgia/studio/CMakeLists.txt +++ b/src/nostalgia/studio/CMakeLists.txt @@ -27,7 +27,6 @@ target_link_libraries( install( FILES nostalgia-studio.json - nostalgia_rom.oxfs DESTINATION share )