From c09cd7512491cee1e82c1ad8128ce9fd4bc3f79b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 22 Sep 2017 23:32:28 +0200 Subject: Initial modularization with both Clang and VC hacks Note: gave up on VC about half way though. --- libbutl/buildfile | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'libbutl/buildfile') diff --git a/libbutl/buildfile b/libbutl/buildfile index fe2e606..6086fd7 100644 --- a/libbutl/buildfile +++ b/libbutl/buildfile @@ -2,7 +2,16 @@ # copyright : Copyright (c) 2014-2017 Code Synthesis Ltd # license : MIT; see accompanying LICENSE file -lib{butl}: {hxx ixx txx cxx}{** -win32-utility -version} {hxx}{version} +int_libs = + +if ($cxx.features.modules && ($force_std_modules == true || $cxx.id != 'msvc')) +{ + import int_libs += libstd-modules%liba{std-modules} + cxx.poptions += -D__cpp_lib_modules +} + +lib{butl}: {mxx hxx ixx txx cxx}{** -win32-utility -version} {hxx}{version} \ + $int_libs # Exclude these from compilation on non-Windows targets. # @@ -33,7 +42,7 @@ if $version.pre_release else lib{butl}: bin.lib.version = @"-$version.major.$version.minor" -bmi{*}: cxx.poptions += -DLIBBUTL_MODULE_BUILD +lib{butl}: cxx.export.libs = $int_libs cxx.poptions =+ "-I$out_root" "-I$src_root" obja{*} bmia{*}: cxx.poptions += -DLIBBUTL_STATIC_BUILD @@ -53,6 +62,11 @@ if ($cxx.target.class == "windows") else cxx.libs += -lpthread +#@@ MOD bogus warning if module and dll-exported function called within DLL. +# +if ($cxx.features.modules && $cxx.id == 'msvc') + cxx.loptions += /ignore:4217 + # Install into the libbutl/ subdirectory of, say, /usr/include/ recreating # subdirectories. # -- cgit v1.1