Conversation
Root cause: root CMakeLists.txt used directory-scoped add_definitions() for USE_ODB_API and ENABLE_GRPC before most add_subdirectory() calls, so toggling either flag changed the compile command for every target in the build (ThirdParty, VizFwk, caf* frameworks included), forcing a full rebuild. Phase 1: removed the two global add_definitions() calls from the root CMakeLists.txt and replaced them with target_compile_definitions() on the actual consumer targets (ApplicationLibCode, ApplicationExeCode, Commands, GeoMechDataModel, GrpcInterface). Phase 2: further narrowed USE_OPENVDS/USE_HDF5/ENABLE_GRPC/USE_ODB_API to set_source_files_properties() on the small set of files that actually reference each macro, so toggling a flag only recompiles a handful of files within ApplicationLibCode/Commands/UnitTests instead of the whole monolithic target. Verified via a full build with the current config (GRPC=ON, OpenVDS=ON, HDF5=ON); fixed a missed H5_BUILT_AS_DYNAMIC_LIB scoping gap in UnitTests that surfaced as HDF5 link errors during verification.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Toggling RESINSIGHT_ENABLE_GRPC, RESINSIGHT_USE_ODB_API, RESINSIGHT_ENABLE_OPENVDS, or the HDF5 detection result currently forces a full rebuild of the entire project (ThirdParty, VizFwk, and all caf* frameworks), even though none of that code references these macros.
Root cause
The root CMakeLists.txt used directory-scoped �dd_definitions() for USE_ODB_API and ENABLE_GRPC before most �dd_subdirectory() calls, so toggling either flag changed the compiler command line for essentially every target in the build.
Fix
Verification
Marked as draft pending final review/testing.