-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set RUSTC_WRAPPER to sccache to speed up building
- Loading branch information
1 parent
d6ede05
commit 92baeff
Showing
9 changed files
with
27 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
# SPDX-FileCopyrightText: 2021 Tenacity Audio Editor contributors | ||
# SPDX-FileContributor: Be <[email protected]> | ||
# SPDX-FileContributor: Emily Mabrey <[email protected]> | ||
# SPDX-FileContributor: Leon Matthes <[email protected]> | ||
# | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
#[=======================================================================[.rst: | ||
CompilerCaching | ||
--------------- | ||
Search for sccache and ccache and use them for compiler caching for C & C++. | ||
ccache is preferred if both are found, but the user can override this by | ||
explicitly setting CCACHE=OFF to use sccache when both are installed. | ||
sccache is preferred if both are found, but the user can override this by | ||
explicitly setting SCCACHE=OFF to use ccache when both are installed. | ||
#]=======================================================================] | ||
|
||
# ccache does not support MSVC | ||
|
@@ -33,14 +34,14 @@ else() | |
option(SCCACHE "Use sccache for compiler caching to speed up rebuilds." ON) | ||
endif() | ||
|
||
if(CCACHE) | ||
message(STATUS "Using ccache for compiler caching to speed up rebuilds") | ||
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") | ||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") | ||
elseif(SCCACHE) | ||
if(SCCACHE) | ||
message(STATUS "Using sccache for compiler caching to speed up rebuilds") | ||
set(CMAKE_C_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}") | ||
set(CMAKE_CXX_COMPILER_LAUNCHER "${SCCACHE_PROGRAM}") | ||
if (NOT DEFINED ENV{RUSTC_WRAPPER}) | ||
# Enable sccache for rustc - especially important when building cxx-qt-lib! | ||
set(CMAKE_RUSTC_WRAPPER "${SCCACHE_PROGRAM}" CACHE PATH "RUSTC_WRAPPER detected by CMake") | ||
endif() | ||
|
||
# Instruct MSVC to generate symbolic debug information within object files for sccache | ||
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") | ||
|
@@ -56,6 +57,10 @@ elseif(SCCACHE) | |
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_${CONFIG} "${CMAKE_C_FLAGS_${CONFIG}}") | ||
endif() | ||
endif() | ||
elseif(CCACHE) | ||
message(STATUS "Using ccache for compiler caching to speed up rebuilds") | ||
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") | ||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") | ||
else() | ||
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") | ||
message(STATUS "No compiler caching enabled. Install sccache to speed up rebuilds.") | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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