mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5370 Unity Build : Add config for ResInsight
This commit is contained in:
parent
4e3a894464
commit
fddc15b1d8
@ -2,6 +2,12 @@ cmake_minimum_required (VERSION 2.8.12)
|
||||
|
||||
project (ApplicationCode)
|
||||
|
||||
if(RESINSIGHT_ENABLE_UNITY_BUILD)
|
||||
message("Cmake Unity build is enabled on : ${PROJECT_NAME}")
|
||||
set(CMAKE_UNITY_BUILD true)
|
||||
endif()
|
||||
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-deprecated-declarations")
|
||||
endif()
|
||||
@ -455,40 +461,41 @@ target_link_libraries( ResInsight ${LINK_LIBRARIES} ${EXTERNAL_LINK_LIBRARIES})
|
||||
|
||||
|
||||
#############################################################################
|
||||
# cotire
|
||||
# cotire and unity builds
|
||||
#############################################################################
|
||||
|
||||
set( UNITY_EXCLUDE_FILES
|
||||
# forever is used as variable name, and this symbol is defined by Qt and used in precompiled headers
|
||||
${ResInsight_SOURCE_DIR}/ThirdParty/gtest/gtest-all.cc
|
||||
|
||||
# multiple QRC files are not supported
|
||||
qrc_cafAnimControl.cxx
|
||||
qrc_ResInsight.cxx
|
||||
|
||||
# mix of cvf and Qt namespaces
|
||||
ModelVisualization/GridBox/RivGridBoxGenerator.cpp
|
||||
ModelVisualization/Intersections/RivIntersectionGeometryGenerator.cpp
|
||||
|
||||
# exclude file using Eigen
|
||||
ReservoirDataModel/RigCellGeometryTools.cpp
|
||||
ReservoirDataModel/Completions/RigTransmissibilityCondenser.cpp
|
||||
ReservoirDataModel/Completions/RigEclipseToStimPlanCellTransmissibilityCalculator.cpp
|
||||
ReservoirDataModel/Completions/RigEclipseToStimPlanCalculator.cpp
|
||||
|
||||
# exclude file using SolveSpace
|
||||
Application/Tools/WellPathTools/RiaSCurveCalculator.cpp
|
||||
|
||||
# QT 5
|
||||
qrc_cafAnimControl.cpp
|
||||
qrc_ResInsight.cpp
|
||||
qrc_cafCommandFeatures.cpp
|
||||
ProjectDataModel/RimContourMapView.cpp
|
||||
Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp
|
||||
)
|
||||
|
||||
if(RESINSIGHT_ENABLE_COTIRE)
|
||||
|
||||
set( COTIRE_EXCLUDE_FILES
|
||||
# forever is used as variable name, and this symbol is defined by Qt and used in precompiled headers
|
||||
${ResInsight_SOURCE_DIR}/ThirdParty/gtest/gtest-all.cc
|
||||
|
||||
# multiple QRC files are not supported
|
||||
qrc_cafAnimControl.cxx
|
||||
qrc_ResInsight.cxx
|
||||
|
||||
# mix of cvf and Qt namespaces
|
||||
ModelVisualization/GridBox/RivGridBoxGenerator.cpp
|
||||
ModelVisualization/Intersections/RivIntersectionGeometryGenerator.cpp
|
||||
|
||||
# exclude file using Eigen
|
||||
ReservoirDataModel/RigCellGeometryTools.cpp
|
||||
ReservoirDataModel/Completions/RigTransmissibilityCondenser.cpp
|
||||
ReservoirDataModel/Completions/RigEclipseToStimPlanCellTransmissibilityCalculator.cpp
|
||||
ReservoirDataModel/Completions/RigEclipseToStimPlanCalculator.cpp
|
||||
|
||||
# exclude file using SolveSpace
|
||||
Application/Tools/WellPathTools/RiaSCurveCalculator.cpp
|
||||
|
||||
# QT 5
|
||||
qrc_cafAnimControl.cpp
|
||||
qrc_ResInsight.cpp
|
||||
qrc_cafCommandFeatures.cpp
|
||||
ProjectDataModel/RimContourMapView.cpp
|
||||
Commands/CompletionExportCommands/RicExportFractureCompletionsImpl.cpp
|
||||
)
|
||||
|
||||
foreach (fileToExclude ${COTIRE_EXCLUDE_FILES})
|
||||
foreach (fileToExclude ${UNITY_EXCLUDE_FILES})
|
||||
set_source_files_properties (${fileToExclude} PROPERTIES COTIRE_EXCLUDED TRUE)
|
||||
endforeach(fileToExclude)
|
||||
|
||||
@ -508,7 +515,11 @@ if(RESINSIGHT_ENABLE_COTIRE)
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
if(RESINSIGHT_ENABLE_UNITY_BUILD)
|
||||
foreach (fileToExclude ${UNITY_EXCLUDE_FILES})
|
||||
set_source_files_properties (${fileToExclude} PROPERTIES SKIP_UNITY_BUILD_INCLUSION TRUE)
|
||||
endforeach(fileToExclude)
|
||||
endif()
|
||||
|
||||
#############################################################################
|
||||
# Copy Dlls on MSVC
|
||||
|
@ -2,6 +2,12 @@ cmake_minimum_required (VERSION 2.8.12)
|
||||
|
||||
project (RigGeoMechDataModel)
|
||||
|
||||
# Unity Build
|
||||
if (RESINSIGHT_ENABLE_UNITY_BUILD)
|
||||
message("Cmake Unity build is enabled on : ${PROJECT_NAME}")
|
||||
set(CMAKE_UNITY_BUILD true)
|
||||
endif()
|
||||
|
||||
add_library( ${PROJECT_NAME}
|
||||
RigFemPart.h
|
||||
RigFemPart.cpp
|
||||
@ -26,10 +32,10 @@ add_library( ${PROJECT_NAME}
|
||||
RigFemPartGrid.cpp
|
||||
RigFemResultAddress.h
|
||||
RigFemResultPosEnum.h
|
||||
RimFemResultObserver.h
|
||||
RimFemResultObserver.cpp
|
||||
RimGeoMechGeometrySelectionItem.h
|
||||
RimGeoMechGeometrySelectionItem.cpp
|
||||
RimFemResultObserver.h
|
||||
RimFemResultObserver.cpp
|
||||
RimGeoMechGeometrySelectionItem.h
|
||||
RimGeoMechGeometrySelectionItem.cpp
|
||||
)
|
||||
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
|
@ -2,6 +2,12 @@ cmake_minimum_required (VERSION 2.8.12)
|
||||
|
||||
project (RifOdbReader)
|
||||
|
||||
# Unity Build
|
||||
if (RESINSIGHT_ENABLE_UNITY_BUILD)
|
||||
message("Cmake Unity build is enabled on : ${PROJECT_NAME}")
|
||||
set(CMAKE_UNITY_BUILD true)
|
||||
endif()
|
||||
|
||||
if (MSVC)
|
||||
add_definitions(-DHKS_NT)
|
||||
add_definitions(-DABQ_WIN86_64)
|
||||
|
@ -59,11 +59,19 @@ include (ResInsightVersion.cmake)
|
||||
find_package(Octave)
|
||||
|
||||
################################################################################
|
||||
# cotire
|
||||
# cotire and CMake Unity Build
|
||||
# Fully automated CMake module for build speedup
|
||||
# https://github.com/sakra/cotire
|
||||
################################################################################
|
||||
|
||||
# CMAKE_UNITY_BUILD was introduced in CMake 3.16.2
|
||||
option(RESINSIGHT_ENABLE_UNITY_BUILD "Experimental speedup of compilation using CMake Unity Build" OFF)
|
||||
mark_as_advanced(FORCE RESINSIGHT_ENABLE_UNITY_BUILD)
|
||||
if(RESINSIGHT_ENABLE_UNITY_BUILD)
|
||||
set(CAF_ENABLE_UNITY_BUILD true)
|
||||
set(CVF_ENABLE_UNITY_BUILD true)
|
||||
endif()
|
||||
|
||||
option(RESINSIGHT_ENABLE_COTIRE "Experimental speedup of compilation using cotire" OFF)
|
||||
mark_as_advanced(FORCE RESINSIGHT_ENABLE_COTIRE)
|
||||
if(RESINSIGHT_ENABLE_COTIRE)
|
||||
|
Loading…
Reference in New Issue
Block a user