Added cotire to speed up build times

This commit is contained in:
Magne Sjaastad 2016-06-06 09:56:45 +02:00
parent e603773417
commit 4fd8e2503c
3 changed files with 3952 additions and 54 deletions

View File

@ -242,60 +242,6 @@ if ( MSVC )
set( WIN_RESOURCE Resources/ResInsight.rc ) set( WIN_RESOURCE Resources/ResInsight.rc )
endif() endif()
#############################################################################
# creating PCH's for MSVC and GCC on Linux
#############################################################################
#set( RAW_SOURCES ${CPP_SOURCES} )
#
#list( REMOVE_ITEM RAW_SOURCES
# RiaStdInclude.cpp
#
# ${CODE_SOURCE_FILES}
#
# ModelVisualization/RivCellEdgeEffectGenerator.cpp
# ModelVisualization/RivPipeGeometryGenerator.cpp
# ModelVisualization/RivWellPipesPartMgr.cpp
# ModelVisualization/RivWellHeadPartMgr.cpp
#
# Application/RiaImageFileCompare.cpp
# Application/RiaImageCompareReporter.cpp
# Application/RiaRegressionTest.cpp
#
# SocketInterface/RiaSocketDataTransfer.cpp
#
# FileInterface/RifEclipseInputFileTools.cpp
# FileInterface/RifEclipseOutputFileTools.cpp
# FileInterface/RifEclipseRestartFilesetAccess.cpp
# FileInterface/RifEclipseRestartDataAccess.cpp
# FileInterface/RifEclipseUnifiedRestartFileAccess.cpp
# FileInterface/RifReaderEclipseInput.cpp
# FileInterface/RifReaderEclipseOutput.cpp
#
# UserInterface/RiuSimpleHistogramWidget.cpp
# UserInterface/RiuMultiCaseImportDialog.cpp
# UserInterface/RiuResultTextBuilder.cpp
#)
#
#include( CustomPCH.cmake )
#set( ALL_INCLUDES
# ${LibCore_SOURCE_DIR}
# ${LibGeometry_SOURCE_DIR}
# ${LibGuiQt_SOURCE_DIR}
# ${LibRender_SOURCE_DIR}
# ${LibViewing_SOURCE_DIR}
# ${QT_INCLUDES}
#)
#
#set( PCH_NAME RiaStdInclude )
#set( GCC_PCH_TARGET gccPCH )
#set( PCH_COMPILER_DEFINE EMPTY )
#IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
# set( PCH_COMPILER_DEFINE CVF_LINUX)
#ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
#
#precompiled_header( RAW_SOURCES ALL_INCLUDES ${GCC_PCH_TARGET} ${PCH_NAME} ${PCH_COMPILER_DEFINE} )
################################################################################ ################################################################################
# Create source groups - see also included CMakeLists_files.cmake # Create source groups - see also included CMakeLists_files.cmake
@ -338,6 +284,22 @@ set( EXE_FILES
add_executable( ResInsight ${EXE_FILES} ) add_executable( ResInsight ${EXE_FILES} )
if(RESINSIGHT_ENABLE_COTIRE)
# forever is used as variable name, and this symbol is defined by Qt and used in precompiled headers
set_source_files_properties (${ResInsight_SOURCE_DIR}/ThirdParty/gtest/gtest-all.cc PROPERTIES COTIRE_EXCLUDED TRUE)
# TODO: Revisit why opm-parser is not working
# Must namespace JsonReader in RifJsonEncodeDecode to guard agains crash with JSON in opm-parser
set_source_files_properties (${ResInsight_SOURCE_DIR}/ApplicationCode/UnitTests/opm-parser-Test.cpp PROPERTIES COTIRE_EXCLUDED TRUE)
set_target_properties(ResInsight PROPERTIES
COTIRE_PREFIX_HEADER_IGNORE_PATH "${COTIRE_PREFIX_HEADER_IGNORE_PATH}"
)
cotire(ResInsight)
endif()
############################################################################# #############################################################################
# Application icon for MacOS X bundle # Application icon for MacOS X bundle

View File

@ -89,6 +89,7 @@ else()
find_package(Boost 1.44.0 COMPONENTS filesystem date_time system regex REQUIRED) find_package(Boost 1.44.0 COMPONENTS filesystem date_time system regex REQUIRED)
endif() endif()
################################################################################ ################################################################################
# ERT # ERT
################################################################################ ################################################################################
@ -329,6 +330,24 @@ set_property(TARGET
PROPERTY FOLDER "AppFwk" PROPERTY FOLDER "AppFwk"
) )
################################################################################
# cotire
# Fully automated CMake module for build speedup
# https://github.com/sakra/cotire
################################################################################
option(RESINSIGHT_ENABLE_COTIRE "Use Cotire to speed up build process" OFF)
if(RESINSIGHT_ENABLE_COTIRE)
set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(cotire)
set(COTIRE_PREFIX_HEADER_IGNORE_PATH
# Avoid Windows Kits includes, as they cause issues for OpenGL and others
"C:/Program Files (x86)/Windows Kits"
)
endif()
################################################################################ ################################################################################
# Installation settings # Installation settings
################################################################################ ################################################################################

3917
cmake/cotire.cmake Normal file

File diff suppressed because it is too large Load Diff