summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-07-22 21:24:07 +0200
committercah <cah@ableton.com>2024-07-23 21:02:28 +0200
commita874e5d1eb85dc778088048dd1aa4521cdeaf29c (patch)
tree70751827c764684983a0e06bc24290b4950d9dfe
parent36798b7f1ba93fa2fa8a153e2db122a593ff4a61 (diff)
Add cscript.
-rw-r--r--cscript37
1 files changed, 37 insertions, 0 deletions
diff --git a/cscript b/cscript
new file mode 100644
index 0000000..11602c4
--- /dev/null
+++ b/cscript
@@ -0,0 +1,37 @@
+# -*- mode: python -*-
+#
+# Copyright (C) 2016 Carl Hetherington <cth@carlh.net>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+
+def build(target, options):
+ if target.platform == 'windows':
+ with open('cross.txt', 'w') as cross:
+ print("[binaries]", file=cross)
+ print("cpp = '%s'" % target.get('CXX').replace('ccache ', '').replace('"', ''), file=cross)
+ print("[host_machine]", file=cross)
+ print("system = 'windows'", file=cross)
+ print("cpu_family = 'x86_64'", file=cross)
+ print("cpu = 'x86_64'", file=cross)
+ print("endian = 'little'", file=cross)
+ print("[properties]", file=cross)
+ print("skip_sanity_check = true", file=cross)
+ cross_file = "--cross-file cross.txt"
+ else:
+ cross_file = ""
+
+ target.command('meson setup %s build --prefix=%s' % (cross_file, target.directory))
+ target.command('ninja -C build install')