diff --git a/CMakeLists.txt b/CMakeLists.txt index 39e991abc..68bbb4df9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,8 @@ project(Ox) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules) include(address_sanitizer) +set(OX_BUILD_EXEC "ON" CACHE STRING "Build executables (ON/OFF)") + if(NOT MSVC) add_definitions( -std=c++11 diff --git a/scripts/setup_build_gba b/scripts/setup_build_gba index 240a24f09..d16a3d3de 100755 --- a/scripts/setup_build_gba +++ b/scripts/setup_build_gba @@ -1,8 +1,8 @@ #! /usr/bin/env bash -project=`pwd` +project=$(pwd) buildDir="build/gba" mkdir -p $buildDir pushd $buildDir -cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_TOOLCHAIN_FILE=cmake/Modules/GBA.cmake -DWOMBAT_BUILD_TYPE=GBA $project +cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_TOOLCHAIN_FILE=cmake/Modules/GBA.cmake $project popd diff --git a/src/ox/fs/CMakeLists.txt b/src/ox/fs/CMakeLists.txt index d4233a7bb..2dcd8bd00 100644 --- a/src/ox/fs/CMakeLists.txt +++ b/src/ox/fs/CMakeLists.txt @@ -5,10 +5,13 @@ add_library( filesystem.cpp ) -add_executable( - oxfstool - oxfstool.cpp -) +if(OX_BUILD_EXEC STREQUAL "ON") + add_executable( + oxfstool + oxfstool.cpp + ) +endif() + set_target_properties(oxfstool PROPERTIES OUTPUT_NAME oxfs) target_link_libraries(oxfstool OxFS OxStd) @@ -25,4 +28,6 @@ install(TARGETS oxfstool RUNTIME DESTINATION bin ) -add_subdirectory(test) +if(OX_BUILD_EXEC STREQUAL "ON") + add_subdirectory(test) +endif()