Repository navigation
Fix unity build errors - #15059
Merged
Merged
Fix unity build errors#15059
Conversation
RimWellEventPerf::State and RimWellEventValve::State are aliases for RimWellEventEnums::State, but the AppEnum setUp() specialization was declared in both class headers and defined in RimWellEventPerf.cpp. The Linux unity build failed to link with an undefined reference to caf::AppEnum<RimWellEventEnums::State>::setUp(). Declare the specialization in RimWellEventEnums.h and define it in the new RimWellEventEnums.cpp, so all users see a single declaration and there is a single definition.
Unity builds compile several test files in one translation unit, so helpers with the same name in anonymous namespaces collided. Give the helpers file-specific names: - RimWorkflowDefinition-Test: taskByName -> definitionTaskByName - RimSummaryCalculationCollection-Test: createFieldCalculation -> createCollectionFieldCalculation - RigPorvSoilSgasResultCalculator-Test: MockCase/createMockCase -> PorvMockCase/createPorvMockCase
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
Fixes for the unity build.
Link error for well event State AppEnum
The Linux unity build fails to link
ResInsight:Since #14912 (5b229cd),
RimWellEventPerf::StateandRimWellEventValve::Stateare aliases for the sharedRimWellEventEnums::State. ThesetUp()specialization was still declared in both class headers and defined inRimWellEventPerf.cpp.caf::AppEnum<RimWellEventEnums::State>::setUp()inRimWellEventEnums.hRimWellEventEnums.cppRimWellEventPerf.h/RimWellEventValve.hand the definition fromRimWellEventPerf.cppName clashes in unit tests
Unity builds compile several test files in one translation unit, so helpers with the same name in anonymous namespaces collided (C2084/C2011). The helpers now have file-specific names:
RimWorkflowDefinition-Test.cpp:taskByName->definitionTaskByNameRimSummaryCalculationCollection-Test.cpp:createFieldCalculation->createCollectionFieldCalculationRigPorvSoilSgasResultCalculator-Test.cpp:MockCase/createMockCase->PorvMockCase/createPorvMockCaseTesting
ResInsightandResInsight-testsbuild and linkResInsight,ResInsight-testsandResInsight-featuretestsbuild and link; unit tests pass (1461 passed, 2 skipped)