aboutsummaryrefslogtreecommitdiff
path: root/libbutl/buildfile
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-08-22 17:26:08 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-08-22 17:36:23 +0200
commitfebb9c275b5247df596876e4eea7fa17b7ec45e7 (patch)
tree214a192cc6b019fb25a659cfdb84601da74438bf /libbutl/buildfile
parentf8fc81a5c9fcd986473797df9286c6c9fef683bf (diff)
Add support for UUID generation
Diffstat (limited to 'libbutl/buildfile')
-rw-r--r--libbutl/buildfile49
1 files changed, 30 insertions, 19 deletions
diff --git a/libbutl/buildfile b/libbutl/buildfile
index d64f630..073ed14 100644
--- a/libbutl/buildfile
+++ b/libbutl/buildfile
@@ -13,8 +13,8 @@ if ($force_std_modules == true)
cxx.poptions += -D__cpp_lib_modules
}
-lib{butl}: {mxx hxx ixx txx cxx}{** -win32-utility -version} {hxx}{version} \
- $int_libs
+lib{butl}: {mxx hxx ixx txx cxx}{** -uuid-* +uuid-io -win32-utility -version} \
+ {hxx}{version} $int_libs
windows = ($cxx.target.class == 'windows')
@@ -22,12 +22,38 @@ windows = ($cxx.target.class == 'windows')
#
lib{butl}: {hxx cxx}{win32-utility}: include = $windows
-# The C-files are included into sha256.cxx (sha256c.c) and timestamp.cxx
-# (strptime.c timelocal.h timelocal.c), so treat them as files to exclude from
+# Our C-files are included into sha256.cxx (sha256c.c) and timestamp.cxx
+# (strptime.c timelocal.h timelocal.c), so treat them as files exclude from
# the compilation.
#
lib{butl}: file{*.c *.h}
+# Platform-specific UUID implementations.
+#
+lib{butl}: cxx{uuid-linux}: include = ($cxx.target.class == 'linux')
+lib{butl}: cxx{uuid-macos}: include = ($cxx.target.class == 'macos')
+lib{butl}: cxx{uuid-windows}: include = $windows
+lib{butl}: cxx{uuid-freebsd}: include = ($cxx.target.system == 'freebsd')
+
+if ($cxx.target.class == 'linux')
+ cxx.libs += -ldl
+elif ($cxx.target.class == 'macos')
+ cxx.libs += -framework CoreFoundation
+elif ($windows)
+ cxx.libs += ($cxx.target.system == 'mingw32' ? -lrpcrt4 : rpcrt4.lib)
+
+# Additional system libraries.
+#
+if $windows
+ cxx.libs += ($cxx.target.system == 'mingw32' ? -limagehlp : imagehlp.lib)
+else
+ cxx.libs += -lpthread
+
+#@@ MOD VC bogus warning if module and dll-exported function called within DLL.
+#
+if ($cxx.features.modules && $cxx.class == 'msvc')
+ cxx.loptions += /ignore:4217
+
# Include the generated version header into the distribution (so that we don't
# pick up an installed one) and don't remove it when cleaning in src (so that
# clean results in a state identical to distributed).
@@ -54,21 +80,6 @@ lib{butl}: cxx.export.poptions = "-I$out_root" "-I$src_root"
liba{butl}: cxx.export.poptions += -DLIBBUTL_STATIC
libs{butl}: cxx.export.poptions += -DLIBBUTL_SHARED
-if $windows
-{
- if ($cxx.target.system == 'mingw32')
- cxx.libs += -limagehlp
- else
- cxx.libs += imagehlp.lib
-}
-else
- cxx.libs += -lpthread
-
-#@@ MOD VC bogus warning if module and dll-exported function called within DLL.
-#
-if ($cxx.features.modules && $cxx.class == 'msvc')
- cxx.loptions += /ignore:4217
-
# Install into the libbutl/ subdirectory of, say, /usr/include/ recreating
# subdirectories.
#