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

+7 -5
View File
@@ -210,17 +210,19 @@ set(LINK_LIBRARIES
if(RESINSIGHT_ENABLE_GRPC)
list(APPEND LINK_LIBRARIES GrpcInterface)
# Scope to the one file that needs it, to avoid a full rebuild on toggle.
set_source_files_properties(
${CMAKE_CURRENT_SOURCE_DIR}/RiaMain.cpp PROPERTIES COMPILE_DEFINITIONS
ENABLE_GRPC
)
endif()
if(RESINSIGHT_USE_ODB_API)
add_definitions(-DUSE_ODB_API)
target_compile_definitions(ResInsight PRIVATE USE_ODB_API)
list(APPEND LINK_LIBRARIES RifOdbReader)
endif()
if(RESINSIGHT_ENABLE_OPENVDS)
add_definitions(-DUSE_OPENVDS)
endif()
target_link_libraries(ResInsight PRIVATE ${LINK_LIBRARIES})
if(UNIX AND NOT APPLE)