mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-24 14:17:52 -05:00
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.
27 lines
727 B
CMake
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
|
|
)
|