| 1 |
# -------------------------------------------------------------------------------------- |
| 2 |
# Copyright (c) 2013-2026, Nucleic Development Team. |
| 3 |
# |
| 4 |
# Distributed under the terms of the Modified BSD License. |
| 5 |
# |
| 6 |
# The full license is in the file LICENSE, distributed with this software. |
| 7 |
# -------------------------------------------------------------------------------------- |
| 8 |
|
| 9 |
# Benchmark executable |
| 10 |
add_executable(kiwi_benchmark |
| 11 |
enaml_like_benchmark.cpp |
| 12 |
) |
| 13 |
|
| 14 |
# Link with kiwi header-only library |
| 15 |
target_link_libraries(kiwi_benchmark PRIVATE kiwi::kiwi) |
| 16 |
|
| 17 |
# Include nanobench header from this directory |
| 18 |
target_include_directories(kiwi_benchmark PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) |
| 19 |
|
| 20 |
# Add output message |
| 21 |
if(CMAKE_BUILD_TYPE MATCHES "Release") |
| 22 |
message(STATUS "Benchmark will be built in Release mode for accurate performance measurements") |
| 23 |
endif() |
| 24 |
|
| 25 |
# Optional: enable optimizations for benchmarks |
| 26 |
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") |
| 27 |
target_compile_options(kiwi_benchmark PRIVATE -O3 -march=native) |
| 28 |
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") |
| 29 |
target_compile_options(kiwi_benchmark PRIVATE /O2) |
| 30 |
endif() |