summaryrefslogtreecommitdiff
path: root/cscript
diff options
context:
space:
mode:
Diffstat (limited to 'cscript')
-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)