aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-11-26 22:18:06 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-11-26 22:18:06 +0300
commit0118cc5f74fdc28ebef8379c33bb4442137d7fa5 (patch)
tree8cedcd96f86a2f92bbed77fe4c3066eecf276409
parent7b5ec08773015128924853c74da8ff711b5ca085 (diff)
Use switch in buildfile
-rw-r--r--libstd-modules/buildfile91
1 files changed, 47 insertions, 44 deletions
diff --git a/libstd-modules/buildfile b/libstd-modules/buildfile
index 1c52ecd..f37ecb1 100644
--- a/libstd-modules/buildfile
+++ b/libstd-modules/buildfile
@@ -21,51 +21,54 @@ else
# Building of the modules gets rather compiler-specific.
#
- if ($cxx.id.type == 'clang')
+ switch $cxx.id.type
{
- # Use the naming scheme expected by -fprebuilt-module-path=. Can also be
- # specified with -fmodule-file=.
- #
- core = std.core.pcm
- io = std.io.pcm
- regex = std.regex.pcm
- threading = std.threading.pcm
-
- liba{std-modules}: bmia{$core $io $regex $threading}
-
- export_target = $out_base/liba{std-modules}
- }
- 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
- regex = $dir/std.regex.ifc
- threading = $dir/std.threading.ifc
-
- bmia{$core $io $regex $threading}: fsdir{$dir}
-
- # VC expects to find std.lib next to the .ifc's. Make it the real one
- # while std-modules -- a dummy.
- #
- ./: $dir/liba{std}
- $dir/liba{std}: bmia{$core $io $regex $threading}
- liba{std-modules}: cxx{dummy.cxx}
-
- # @@ Doesn't work if installed so we don't bother installing it. But we
- # still install dummy std-modules; the idea is to link a dummy and
- # (try) to use Microsoft-shipped .ifc's?
- #
- $dir/liba{std}: install = false
-
- # Include std-modules to trigger install.
- #
- export_target = $out_base/$dir/liba{std} $out_base/liba{std-modules}
+ case '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
+ regex = std.regex.pcm
+ threading = std.threading.pcm
+
+ liba{std-modules}: bmia{$core $io $regex $threading}
+
+ export_target = $out_base/liba{std-modules}
+ }
+ case '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
+ regex = $dir/std.regex.ifc
+ threading = $dir/std.threading.ifc
+
+ bmia{$core $io $regex $threading}: fsdir{$dir}
+
+ # VC expects to find std.lib next to the .ifc's. Make it the real one
+ # while std-modules -- a dummy.
+ #
+ ./: $dir/liba{std}
+ $dir/liba{std}: bmia{$core $io $regex $threading}
+ liba{std-modules}: cxx{dummy.cxx}
+
+ # @@ Doesn't work if installed so we don't bother installing it. But we
+ # still install dummy std-modules; the idea is to link a dummy and
+ # (try) to use Microsoft-shipped .ifc's?
+ #
+ $dir/liba{std}: install = false
+
+ # Include std-modules to trigger install.
+ #
+ export_target = $out_base/$dir/liba{std} $out_base/liba{std-modules}
+ }
}
liba{std-modules}: hxx{*}