summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-06-11 10:38:17 +0200
committerCarl Hetherington <cth@carlh.net>2020-06-11 10:49:03 +0200
commit585b84a5d409f6b98f17e15c41ea6d7c21c2a773 (patch)
treecc8757b996c9d85b4331f92661d86211c013564f
parent956af06b580e52f6b5ea2ed5f70f0c92ed267fc6 (diff)
Fix Windows builds with ccache.ccache
-rw-r--r--cscript7
1 files changed, 6 insertions, 1 deletions
diff --git a/cscript b/cscript
index f6887a7d..d13b7784 100644
--- a/cscript
+++ b/cscript
@@ -8,7 +8,12 @@ def build(target, options):
target.set('PATH', '%s:%s' % (target.tool_path, os.environ['PATH']))
f = open('mingw.cmake', 'w')
print("SET(CMAKE_SYSTEM_NAME Windows)", file=f)
- print("SET(CMAKE_C_COMPILER %s/%s)" % (target.tool_path, target.get('CC')), file=f)
+ cc = target.get('CC')
+ cc = cc.replace("ccache ", "")
+ cc = cc.replace("\"", "")
+ if target.ccache:
+ print("set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)", file=f)
+ print("SET(CMAKE_C_COMPILER %s/%s)" % (target.tool_path, cc), file=f)
print("SET(CMAKE_RC_COMPILER %s/%s)" % (target.tool_path, target.get('WINRC')), file=f)
all = "%s " % target.library_prefix
print("SET(CMAKE_ROOT_FIND_PATH %s %s)" % (all, target.tool_path), file=f)