[ox] Fix incorrect setting of build config when passed in from another CMakeLists.txt

This commit is contained in:
Gary Talent 2019-06-15 09:44:04 -05:00
parent 30ff7be0e4
commit 36d8aeabd3
2 changed files with 18 additions and 4 deletions

View File

@ -5,10 +5,23 @@ 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)")
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)")
set(OX_BARE_METAL FALSE CACHE STRING "Bare metal build (TRUE/FALSE)")
if(NOT DEFINED OX_RUN_TESTS)
set(OX_RUN_TESTS "ON")
endif()
if(NOT DEFINED OX_RUN_TESTS)
set(OX_RUN_TESTS "ON")
endif()
if(NOT DEFINED OX_USE_STDLIB)
set(OX_USE_STDLIB "ON")
endif()
if(NOT DEFINED OX_BARE_METAL)
set(OX_BARE_METAL FALSE)
endif()
set(OX_RUN_TESTS ${OX_RUN_TESTS} CACHE STRING "Run tests (ON/OFF)")
set(OX_RUN_TESTS ${OX_RUN_TESTS} CACHE STRING "Run tests (ON/OFF)")
set(OX_USE_STDLIB ${OX_USE_STDLIB} CACHE STRING "Build libraries that need the std lib (ON/OFF)")
set(OX_BARE_METAL ${OX_BARE_METAL} CACHE STRING "Bare metal build (TRUE/FALSE)")
# can't run tests without building them
if(OX_BUILD_EXEC STREQUAL "OFF" OR OX_USE_STDLIB STREQUAL "OFF")

View File

@ -10,6 +10,7 @@ add_library(
)
if(NOT OX_BARE_METAL)
message("fs link c++fs")
target_link_libraries(
OxFS PUBLIC
$<$<CXX_COMPILER_ID:Clang>:c++fs>