Add OX_BUILD_EXEC option to CMake files
This commit is contained in:
@@ -5,6 +5,8 @@ project(Ox)
|
|||||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules)
|
||||||
include(address_sanitizer)
|
include(address_sanitizer)
|
||||||
|
|
||||||
|
set(OX_BUILD_EXEC "ON" CACHE STRING "Build executables (ON/OFF)")
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
add_definitions(
|
add_definitions(
|
||||||
-std=c++11
|
-std=c++11
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
project=`pwd`
|
project=$(pwd)
|
||||||
buildDir="build/gba"
|
buildDir="build/gba"
|
||||||
|
|
||||||
mkdir -p $buildDir
|
mkdir -p $buildDir
|
||||||
pushd $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
|
popd
|
||||||
|
|||||||
@@ -5,10 +5,13 @@ add_library(
|
|||||||
filesystem.cpp
|
filesystem.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(
|
if(OX_BUILD_EXEC STREQUAL "ON")
|
||||||
oxfstool
|
add_executable(
|
||||||
oxfstool.cpp
|
oxfstool
|
||||||
)
|
oxfstool.cpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
set_target_properties(oxfstool PROPERTIES OUTPUT_NAME oxfs)
|
set_target_properties(oxfstool PROPERTIES OUTPUT_NAME oxfs)
|
||||||
target_link_libraries(oxfstool OxFS OxStd)
|
target_link_libraries(oxfstool OxFS OxStd)
|
||||||
|
|
||||||
@@ -25,4 +28,6 @@ install(TARGETS oxfstool
|
|||||||
RUNTIME DESTINATION bin
|
RUNTIME DESTINATION bin
|
||||||
)
|
)
|
||||||
|
|
||||||
add_subdirectory(test)
|
if(OX_BUILD_EXEC STREQUAL "ON")
|
||||||
|
add_subdirectory(test)
|
||||||
|
endif()
|
||||||
|
|||||||
Reference in New Issue
Block a user