forked from ccache/ccache
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Move Windows config and cache to LOCALAPPDATA
Add a variadic template helper function PATH(std::string...) to construct native paths using std::filesystem. Throw a fatal error if a cache is detected in APPDATA. Fix-up default cmake install directories and set system-wide config to C:\ProgramData\ccache\ccache.conf . Update manual. Fix ccache#1023 Fix ccache#946 Signed-off-by: Rafael Kitover <rkitover@gmail.com>
- Loading branch information
Showing
6 changed files
with
139 additions
and
29 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,29 @@ | ||
if(WIN32) | ||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) | ||
set(programfiles "$ENV{ProgramFiles}") | ||
|
||
# For 32 bit builds. | ||
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 4 AND ENV{ProgramFiles\(x86\)}) | ||
set(programfiles "$ENV{ProgramFiles\(x86\)}") | ||
endif() | ||
|
||
string(REPLACE "\\" "\\\\" programfiles "${programfiles}") | ||
|
||
set(CMAKE_INSTALL_PREFIX "${programfiles}\\\\ccache" CACHE STRING "System-wide installation location" FORCE) | ||
endif() | ||
|
||
if(NOT CMAKE_INSTALL_SYSCONFDIR) | ||
string(REPLACE "\\" "\\\\" programdata "$ENV{ALLUSERSPROFILE}") | ||
if(NOT programdata) | ||
set(programdata "C:\\\\ProgramData") | ||
endif() | ||
|
||
set(CMAKE_INSTALL_SYSCONFDIR "${programdata}\\\\ccache" CACHE STRING "System-wide configuration location" FORCE) | ||
endif() | ||
|
||
set(CMAKE_INSTALL_BINDIR "" CACHE PATH "" FORCE) | ||
set(CMAKE_INSTALL_LIBEXECDIR "" CACHE PATH "" FORCE) | ||
set(CMAKE_INSTALL_SBINDIR "" CACHE PATH "" FORCE) | ||
endif() | ||
|
||
include(GNUInstallDirs) |
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