diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ff96a9e..93a7c1d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,4 +30,7 @@ endif() enable_testing() +add_subdirectory(deps/ox) +include_directories(deps/ox/src) + add_subdirectory(src) diff --git a/Dockerfile b/Dockerfile index 5f9c3962..e26383b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,37 +4,3 @@ ENV DEVKITPRO /opt/devkitPro ENV DEVKITARM ${DEVKITPRO}/devkitARM RUN dnf install -y qt5-devel llvm libasan - -############################################################################### -# Install Ox - -RUN git clone https://github.com/wombatant/ox.git /usr/local/src/ox && \ - cd /usr/local/src/ox && \ - git checkout -b install a5166e03bbaea2f200cfc730c69579c3d50ae2a7 - - # setup build dirs -RUN mkdir -p \ - /usr/local/src/ox/build/release \ - /usr/local/src/ox/build/windows \ - /usr/local/src/ox/build/gba; - - # install Ox for native environment -RUN cd /usr/local/src/ox/build/release && \ - cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ../../ && \ - make -j install - - # install Ox for GBA -RUN cd /usr/local/src/ox/build/gba && \ - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ - -DCMAKE_TOOLCHAIN_FILE=cmake/Modules/GBA.cmake \ - -DCMAKE_INSTALL_PREFIX=/opt/devkitPro/devkitARM \ - -DOX_USE_STDLIB=OFF ../../ && \ - make -j install - - # install Ox for Windows -RUN cd /usr/local/src/ox/build/windows && \ - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ - -DCMAKE_TOOLCHAIN_FILE=cmake/Modules/Mingw.cmake \ - -DCMAKE_INSTALL_PREFIX=/usr/x86_64-w64-mingw32 \ - -DOX_BUILD_EXEC=OFF ../../ && \ - make -j install diff --git a/scripts/setup_build b/scripts/setup_build index 2aa0a7c3..444eead3 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" + toolchain="-DCMAKE_TOOLCHAIN_FILE=cmake/Modules/GBA.cmake -DWOMBAT_BUILD_TYPE=GBA -DOX_USE_STDLIB=OFF -DCMAKE_INSTALL_PREFIX=$DEVKITARM" fi if [[ $BUILD_TYPE == debug ]]; then diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 045aa9cd..979d15b0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -6,10 +6,6 @@ if(NOT WOMBAT_BUILD_TYPE STREQUAL "GBA") find_package(Qt5Widgets) endif() -find_package(Ox REQUIRED) -include_directories(${Ox_INCLUDE_DIRS}) - - #project packages include_directories(".") diff --git a/src/core/gba/gba.hpp b/src/core/gba/gba.hpp index 29225945..4c5d0e80 100644 --- a/src/core/gba/gba.hpp +++ b/src/core/gba/gba.hpp @@ -21,7 +21,7 @@ typedef uint16_t Pallete[256]; typedef Tile CharBlock[512]; typedef Tile8 CharBlock8[256]; -struct __attribute__((aligned(4))) GbaImageData { +struct __attribute__((packed)) GbaImageData { Pallete pal; uint16_t tileCount; uint8_t bpp; diff --git a/src/player/CMakeLists.txt b/src/player/CMakeLists.txt index 63fb5de7..2002182d 100644 --- a/src/player/CMakeLists.txt +++ b/src/player/CMakeLists.txt @@ -21,6 +21,6 @@ endif() target_link_libraries( nostalgia NostalgiaCore - ${OxStd_LIBRARY} - ${OxFS_LIBRARY} + OxStd + OxFS ) diff --git a/src/studio/CMakeLists.txt b/src/studio/CMakeLists.txt index 8fa29598..dfa25328 100644 --- a/src/studio/CMakeLists.txt +++ b/src/studio/CMakeLists.txt @@ -15,9 +15,9 @@ target_link_libraries( nostalgia-studio Qt5::Core Qt5::Widgets - ${OxClArgs_LIBRARY} - ${OxFS_LIBRARY} - ${OxStd_LIBRARY} + OxClArgs + OxFS + OxStd NostalgiaCommon NostalgiaCore NostalgiaStudioStatic diff --git a/src/studio/lib/CMakeLists.txt b/src/studio/lib/CMakeLists.txt index 84163a56..4054d306 100644 --- a/src/studio/lib/CMakeLists.txt +++ b/src/studio/lib/CMakeLists.txt @@ -22,8 +22,8 @@ target_link_libraries( NostalgiaStudioStatic Qt5::Core Qt5::Widgets - ${OxFS_LIBRARY} - ${OxStd_LIBRARY} + OxFS + OxStd ) add_library( @@ -36,8 +36,8 @@ target_link_libraries( Qt5::Core Qt5::Widgets NostalgiaStudioStatic - ${OxFS_LIBRARY} - ${OxStd_LIBRARY} + OxFS + OxStd ) install( diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt index b3ef7c1c..be2c6a08 100644 --- a/src/tools/CMakeLists.txt +++ b/src/tools/CMakeLists.txt @@ -10,9 +10,9 @@ add_executable(nost-pack pack.cpp) target_link_libraries( nost-pack Qt5::Widgets - ${OxClArgs_LIBRARY} - ${OxFS_LIBRARY} - ${OxStd_LIBRARY} + OxClArgs + OxFS + OxStd NostalgiaCommon NostalgiaCore )