From 585b84a5d409f6b98f17e15c41ea6d7c21c2a773 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 11 Jun 2020 10:38:17 +0200 Subject: Fix Windows builds with ccache. --- cscript | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3