mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add support for compiler launcher using buildcache
Use CMAKE_CXX_COMPILER_LAUNCHER if buildcache is found in path
This commit is contained in:
parent
a1eb707b02
commit
e3115bfef9
@ -1,5 +1,18 @@
|
||||
cmake_minimum_required (VERSION 2.8.12)
|
||||
|
||||
################################################################################
|
||||
# buildcache
|
||||
#
|
||||
# buildcache will be used if found in path
|
||||
################################################################################
|
||||
find_program(buildcache_program buildcache)
|
||||
if(buildcache_program)
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER "${buildcache_program}")
|
||||
message( STATUS "Found buildcache from : ${buildcache_program}" )
|
||||
else()
|
||||
message( STATUS "No buildcache found" )
|
||||
endif()
|
||||
|
||||
include (CheckCSourceCompiles)
|
||||
project (ResInsight)
|
||||
|
||||
@ -91,6 +104,11 @@ include(cafCotireTools)
|
||||
# ERT
|
||||
################################################################################
|
||||
|
||||
# Use of CMAKE_CXX_COMPILER_LAUNCHER is not working with libecl. Disable by temporarily setting
|
||||
# compiler launcher to nothing
|
||||
set(TEMP_CMAKE_CXX_COMPILER_LAUNCHER ${CMAKE_CXX_COMPILER_LAUNCHER})
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER)
|
||||
|
||||
if (NOT MSVC)
|
||||
# Linux: Optional configuration of externally installed ERT, requires path to libraries and includes
|
||||
set(RESINSIGHT_ERT_EXTERNAL_LIB_ROOT "" CACHE PATH "Path to installed ERT libraries")
|
||||
@ -160,6 +178,9 @@ else()
|
||||
|
||||
endif(RESINSIGHT_ERT_EXTERNAL_LIB_ROOT OR RESINSIGHT_ERT_EXTERNAL_INCLUDE_ROOT)
|
||||
|
||||
# restore buildcache when libecl has been configured
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER ${TEMP_CMAKE_CXX_COMPILER_LAUNCHER})
|
||||
|
||||
###############################################
|
||||
# Init GIT submodules if they haven't already #
|
||||
###############################################
|
||||
|
Loading…
Reference in New Issue
Block a user