From febb9c275b5247df596876e4eea7fa17b7ec45e7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 22 Aug 2018 17:26:08 +0200 Subject: Add support for UUID generation --- libbutl/buildfile | 49 ++++++++++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 19 deletions(-) (limited to 'libbutl/buildfile') 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. # -- cgit v1.1