forked from melonDS-emu/melonDS
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use RULE_LAUNCH_COMPILE property as you're apparently supposed to * Detect if compiler is already ccache to prevent build failure
- Loading branch information
1 parent
5ab8161
commit 747f50d
Showing
2 changed files
with
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
include(FindPackageMessage) | ||
|
||
find_program(CCACHE "ccache") | ||
|
||
cmake_dependent_option(USE_CCACHE "Use CCache to speed up repeated builds." ON CCACHE OFF) | ||
|
||
if (NOT CCACHE OR NOT USE_CCACHE) | ||
return() | ||
endif() | ||
|
||
# Fedora, and probably also Red Hat-based distros in general, use CCache by default if it's installed on the system. | ||
# We'll try to detect this here, and exit if that's the case. | ||
# Trying to launch ccache with ccache as we'd otherwise do seems to cause build issues. | ||
if (CMAKE_C_COMPILER MATCHES "ccache" OR CMAKE_CXX_COMPILER MATCHES "ccache") | ||
return() | ||
endif() | ||
|
||
find_package_message(CCache "Using CCache to speed up compilation" "${USE_CCACHE}") | ||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE}") |