Files
ResInsight/Fwk/AppFwk/cafProjectDataModel/cafPdm_CompileBench/CMakeLists.txt
T
Magne Sjaastad e0a3606ae1 Add cafPdm_CompileBench target for compile-time benchmarking
Adds an OBJECT library with UNITY_BUILD OFF to measure per-file compile
cost of PDM field types in isolation. Wired into both Fwk/CMakeLists.txt
and the main CMakeLists.txt (under RESINSIGHT_INCLUDE_APPFWK_TESTS).
Also adds build-bench to .gitignore.
2026-04-08 12:37:36 +02:00

27 lines
727 B
CMake

cmake_minimum_required(VERSION 3.15)
project(cafPdm_CompileBench)
find_package(
Qt6
COMPONENTS
REQUIRED Core Widgets
)
qt_standard_project_setup()
set(PROJECT_FILES
bench_basic_fields.cpp bench_enum_fields.cpp bench_container_fields.cpp
bench_filepath_fields.cpp bench_mixed_fields.cpp
)
# OBJECT library: compiles each file individually without linking. This isolates
# the compile-time cost per translation unit.
add_library(${PROJECT_NAME} OBJECT ${PROJECT_FILES})
# Disable unity build for this target — each file must compile independently
set_target_properties(${PROJECT_NAME} PROPERTIES UNITY_BUILD OFF)
target_link_libraries(
${PROJECT_NAME} PRIVATE cafProjectDataModel Qt6::Core Qt6::Widgets
)