Scope GRPC/ODB/OpenVDS/HDF5 build flags to avoid full rebuilds

- Remove unused SOURCE_GROUP_HEADER_FILES from GrpcInterface CMakeLists
- Scope the following defines to the files that need it ENABLE_GRPC, USE_ODB_API , USE_OPENVDS, USE_HDF5 
- RifOdbReader.cpp copied an odb_InstanceRepository by value, which
  fails to compile under MSVC's strict conformance mode due to an
  ambiguous implicit copy constructor in the vendor headers (diamond
  inheritance). Use a reference instead, since it was only ever read
  from.
This commit is contained in:
Magne Sjaastad authored and GitHub committed 2026-10-02 12:24:29 +02:00
1 parent fa5ba28b0d
commit b6704429cd
10 files changed
+250 -103

No files matched your search

+30 -1
View File
@@ -75,8 +75,37 @@ find_package(Eigen3 REQUIRED)
add_library(${PROJECT_NAME} OBJECT ${COMMAND_CODE_SOURCE_FILES})
# Scope USE_OPENVDS/USE_ODB_API to the files that use them, to avoid a full
# rebuild on toggle.
if(RESINSIGHT_ENABLE_OPENVDS)
add_definitions(-DUSE_OPENVDS)
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/SeismicCommands/RicImportSeismicFeature.cpp
PROPERTIES COMPILE_DEFINITIONS USE_OPENVDS
)
endif()
if(RESINSIGHT_USE_ODB_API)
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/GeoMechCommands/RicGeoMechCopyCaseFeature.cpp
${CMAKE_CURRENT_SOURCE_DIR}/GeoMechCommands/RicImportGeoMechCaseFeature.cpp
${CMAKE_CURRENT_SOURCE_DIR}/GeoMechCommands/RicImportGeoMechCaseTimeStepFilterFeature.cpp
PROPERTIES COMPILE_DEFINITIONS USE_ODB_API
)
endif()
# RicHelpFeatures.cpp references both USE_ODB_API and USE_HDF5.
if(RESINSIGHT_USE_ODB_API OR RESINSIGHT_FOUND_HDF5)
set(RIC_HELP_FEATURES_DEFS "")
if(RESINSIGHT_USE_ODB_API)
list(APPEND RIC_HELP_FEATURES_DEFS USE_ODB_API)
endif()
if(RESINSIGHT_FOUND_HDF5)
list(APPEND RIC_HELP_FEATURES_DEFS USE_HDF5)
endif()
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/ApplicationCommands/RicHelpFeatures.cpp
PROPERTIES COMPILE_DEFINITIONS "${RIC_HELP_FEATURES_DEFS}"
)
endif()
if(RESINSIGHT_ENABLE_PRECOMPILED_HEADERS)