include building benchmark in test option

This commit is contained in:
pantor
2024-10-05 10:01:11 +02:00
parent de5e742654
commit 8695d7525f
4 changed files with 1 additions and 7 deletions

View File

@@ -30,7 +30,7 @@ jobs:
- name: ubuntu-22.04-clang-15-no-exceptions
os: ubuntu-22.04
compiler: clang-15
cmake_vars: "-DCMAKE_CXX_FLAGS=-fno-exceptions -DBUILD_TESTING=OFF -DBUILD_BENCHMARK=ON"
cmake_vars: "-DCMAKE_CXX_FLAGS=-fno-exceptions -DBUILD_TESTING=OFF"
- name: ubuntu-22.04-gcc
os: ubuntu-22.04

View File

@@ -14,7 +14,6 @@ option(INJA_INSTALL_SINGLE_HEADER "Install the single header instead" OFF)
option(INJA_EXPORT "Export the current build tree to the package registry" ON)
option(BUILD_TESTING "Build unit tests" ON)
option(INJA_BUILD_TESTS "Build unit tests when BUILD_TESTING is enabled." ON)
option(BUILD_BENCHMARK "Build benchmark" ON)
option(COVERALLS "Generate coveralls data" OFF)
@@ -103,10 +102,8 @@ if(BUILD_TESTING AND INJA_BUILD_TESTS)
target_include_directories(single_inja_test PRIVATE include third_party/include)
add_test(single_inja_test ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/single_inja_test)
endif()
if(BUILD_BENCHMARK)
add_executable(inja_benchmark test/benchmark.cpp)
target_link_libraries(inja_benchmark PRIVATE inja)
endif()

View File

@@ -52,10 +52,8 @@ if get_option('build_tests')
test('Inja unit test', inja_test)
test('Inja single include test', inja_single_test)
endif
if get_option('build_benchmark')
inja_benchmark = executable(
'inja_benchmark',
'test/benchmark.cpp',

View File

@@ -1,2 +1 @@
option('build_tests', type: 'boolean', value: true)
option('build_benchmark', type: 'boolean', value: true)