aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/buildfile
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/cc/buildfile')
-rw-r--r--libbuild2/cc/buildfile36
1 files changed, 29 insertions, 7 deletions
diff --git a/libbuild2/cc/buildfile b/libbuild2/cc/buildfile
index fc8809d..7dcd811 100644
--- a/libbuild2/cc/buildfile
+++ b/libbuild2/cc/buildfile
@@ -4,16 +4,35 @@
# NOTE: shared imports should go into root.build.
#
include ../
-imp_libs = ../lib{build2} # Implied interface dependency.
+impl_libs = ../lib{build2} # Implied interface dependency.
-import imp_libs += libpkgconf%lib{pkgconf}
+libpkgconf = $config.build2.libpkgconf
+
+if $libpkgconf
+ import impl_libs += libpkgconf%lib{pkgconf}
+else
+ import impl_libs += libpkg-config%lib{pkg-config}
include ../bin/
-int_libs = ../bin/lib{build2-bin}
+intf_libs = ../bin/lib{build2-bin}
+
+./: lib{build2-cc}: libul{build2-cc}: \
+ {hxx ixx txx cxx}{** -pkgconfig-lib* -**.test...} \
+ h{msvc-setup}
+
+libul{build2-cc}: cxx{pkgconfig-libpkgconf}: include = $libpkgconf
+libul{build2-cc}: cxx{pkgconfig-libpkg-config}: include = (!$libpkgconf)
+
+libul{build2-cc}: $intf_libs $impl_libs
-./: lib{build2-cc}: libul{build2-cc}: {hxx ixx txx cxx}{** -**.test...} \
- h{msvc-setup} \
- $int_libs $imp_libs
+# libc++ std module interface translation unit.
+#
+# Hopefully temporary, see llvm-project GH issues #73089.
+#
+# @@ TMP: make sure sync'ed with upstream before release (keep this note).
+#
+lib{build2-cc}: file{std.cppm}
+file{std.cppm}@./: install = data/libbuild2/cc/
# Unit tests.
#
@@ -38,6 +57,9 @@ for t: cxx{**.test...}
obja{*}: cxx.poptions += -DLIBBUILD2_CC_STATIC_BUILD
objs{*}: cxx.poptions += -DLIBBUILD2_CC_SHARED_BUILD
+if $libpkgconf
+ cxx.poptions += -DBUILD2_LIBPKGCONF
+
if ($cxx.target.class == 'windows')
cxx.libs += $regex.apply(advapi32 ole32 oleaut32, \
'(.+)', \
@@ -50,7 +72,7 @@ if ($cxx.target.class == 'windows')
lib{build2-cc}:
{
cxx.export.poptions = "-I$out_root" "-I$src_root"
- cxx.export.libs = $int_libs
+ cxx.export.libs = $intf_libs
}
liba{build2-cc}: cxx.export.poptions += -DLIBBUILD2_CC_STATIC