Skip to content

Commit

Permalink
optional benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
pantor committed Dec 14, 2018
1 parent 6bae3a7 commit d90f93f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ set(INJA_VERSION ${PROJECT_VERSION})
## OPTIONS
##
option(BUILD_UNIT_TESTS "Build the unit tests" ON)
option(BUILD_BENCHMARK "Build the inja benchmark" OFF)
option(HUNTER_ENABLED "Use hunter to manage dependencies" OFF)


Expand Down
20 changes: 12 additions & 8 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ endif()


##
## TARGETS
## TESTS
##
add_executable(inja_test
src/unit-files.cpp
Expand All @@ -28,14 +28,7 @@ add_executable(inja_single_test
src/unit.cpp
)

add_executable(inja_benchmark
src/benchmark.cpp
)


##
## INCLUDES
##
if(HUNTER_ENABLED) # Use Hunter to manage dependencies
# Add Catch framework
hunter_add_package(Catch)
Expand All @@ -59,6 +52,17 @@ else() # Manage dependencies manually
# Add dependencies to targets
target_link_libraries(inja_test Catch inja)
target_link_libraries(inja_single_test Catch inja_single)
endif()


##
## BENCHMARK
##
if(BUILD_BENCHMARK)
add_executable(inja_benchmark
src/benchmark.cpp
)

target_link_libraries(inja_benchmark hayai inja)
endif()

Expand Down

0 comments on commit d90f93f

Please sign in to comment.