From 91838156349cd4bac3321068f9475200ec98cba7 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Thu, 13 Apr 2017 04:31:30 -0500 Subject: [PATCH] Fix GBA build not to build libraries that use stdlib --- CMakeLists.txt | 4 +++- scripts/setup_build | 2 +- src/ox/CMakeLists.txt | 4 +++- src/ox/fs/filesystem.cpp | 1 - 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d093272fb..ccc056f01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,9 +7,11 @@ include(address_sanitizer) set(OX_BUILD_EXEC "ON" CACHE STRING "Build executables (ON/OFF)") set(OX_RUN_TESTS "ON" CACHE STRING "Run tests (ON/OFF)") +set(OX_USE_STDLIB "ON" CACHE STRING "Build libraries that need the std lib (ON/OFF)") # can't run tests without building them -if(OX_BUILD_EXEC STREQUAL "OFF") +if(OX_BUILD_EXEC STREQUAL "OFF" OR OX_USE_STDLIB STREQUAL "OFF") + set(OX_BUILD_EXEC "OFF") set(OX_RUN_TESTS "OFF") endif() diff --git a/scripts/setup_build b/scripts/setup_build index 7826a3754..b61c9eb79 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 -DOX_BUILD_EXEC=OFF" + toolchain="-DCMAKE_TOOLCHAIN_FILE=cmake/Modules/GBA.cmake -DOX_USE_STDLIB=OFF" fi if [[ $BUILD_TYPE == debug ]]; then diff --git a/src/ox/CMakeLists.txt b/src/ox/CMakeLists.txt index d0dd6848e..e77392db5 100644 --- a/src/ox/CMakeLists.txt +++ b/src/ox/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 2.8) -add_subdirectory(clargs) +if(OX_USE_STDLIB STREQUAL "ON") + add_subdirectory(clargs) +endif(OX_USE_STDLIB STREQUAL "ON") add_subdirectory(fs) add_subdirectory(std) diff --git a/src/ox/fs/filesystem.cpp b/src/ox/fs/filesystem.cpp index 71bd3f3ed..9294a16be 100644 --- a/src/ox/fs/filesystem.cpp +++ b/src/ox/fs/filesystem.cpp @@ -5,7 +5,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include #include "filesystem.hpp" namespace ox {