From a0f96b95900108705261881b164d779e2db5b824 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 19 Jul 2017 17:50:36 +0200 Subject: Initial implementation --- buildfile | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 buildfile (limited to 'buildfile') diff --git a/buildfile b/buildfile new file mode 100644 index 0000000..0efdd29 --- /dev/null +++ b/buildfile @@ -0,0 +1,65 @@ +# file : buildfile +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +# We only do the static library since this is what we would have gotten should +# we have used headers (i.e., whatever object code generated from those headers +# would have ended up in each executable/library). +# +./: liba{std-modules} tests/ doc{INSTALL LICENSE NEWS README version} \ + file{manifest} + +doc{version}: file{manifest} # Generated by the version module. +doc{version}: dist = true + +# Don't install tests or the INSTALL file. +# +dir{tests/}: install = false +doc{INSTALL}@./: install = false + +# Building of the modules gets rather compiler-specific. +# +if ($cxx.id.type == 'clang') +{ + # Use the naming scheme expected by -fprebuilt-module-path=. Can also be + # specified with -fmodule-file=. + # + core = std.core.pcm + io = std.io.pcm +} +elif ($cxx.id.type == 'msvc') +{ + # Use the naming scheme expected by /module:stdIfcDir. Note that IFCPATH + # would require an extra directory (x64 or x86; e.g., x64/Release/). + # + # @@ Currently VC looks in Release regardless of /MD or /MDd. + # + dir = release/ + core = $dir/std.core.ifc + io = $dir/std.io.ifc + + bmia{$core $io}: fsdir{$dir} + + # VC expects to find std.lib next to the .ifc's. Make it a dummy one. + # + liba{std-modules}: $dir/liba{std} + $dir/liba{std}: cxx{dummy.cxx} +} + +# @@ TMP: use utility library instead? +# +if ($cxx.target.class == 'linux' || $cxx.target.class == 'bsd') + cxx.coptions += -fPIC + +# Clang 5.0 with libc++ (sometimes) needs it -- go figure. +# +if ($cxx.target.class != "windows") + cxx.libs += -lpthread + +liba{std-modules}: bmia{$core $io} + +bmia{$core}: mxx{std-core} +bmia{$io}: mxx{std-io} bmia{$core} + +mxx{std-core}@./: cc.module_name = std.core +mxx{std-io}@./: cc.module_name = std.io -- cgit v1.1