Enable unity build on opm-common

This commit is contained in:
Magne Sjaastad 2020-11-16 14:55:45 +01:00
parent be23df1398
commit b0ec2895be
2 changed files with 21 additions and 0 deletions

View File

@ -324,7 +324,10 @@ add_subdirectory(ThirdParty/qwt)
if(RESINSIGHT_ENABLE_UNITY_BUILD)
message("Cmake Unity build is enabled on : qwt")
set_property(TARGET qwt PROPERTY UNITY_BUILD true)
message("Cmake Unity build is enabled on : custom-opm-flowdiagnostics")
set_property(TARGET custom-opm-flowdiagnostics PROPERTY UNITY_BUILD true)
message("Cmake Unity build is enabled on : custom-opm-common")
set_property(TARGET custom-opm-common PROPERTY UNITY_BUILD true)
endif()
list(APPEND THIRD_PARTY_LIBRARIES

View File

@ -85,6 +85,24 @@ add_library(${PROJECT_NAME}
opm-common/src/opm/io/eclipse/rst/header.cpp
)
if(RESINSIGHT_ENABLE_UNITY_BUILD)
set(UNITY_EXCLUDE_FILES
opm-common/src/opm/parser/eclipse/Deck/UDAValue.cpp
opm-common/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.cpp
opm-common/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunction.cpp
opm-common/src/opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.cpp
opm-common/src/opm/parser/eclipse/EclipseState/Schedule/MSW/SpiralICD.cpp
opm-common/src/opm/io/eclipse/EclOutput.cpp
)
foreach(fileToExclude ${UNITY_EXCLUDE_FILES})
set_source_files_properties(${fileToExclude}
PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE)
endforeach(fileToExclude)
endif()
find_path(BOOST_SPIRIT_INCLUDE_DIRS "boost/spirit.hpp")
target_link_libraries(custom-opm-common