aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-09-02 14:23:33 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-09-02 14:23:33 +0200
commitc97b19321969cce9fd497da083d5a3bfb0392e13 (patch)
treedeea1f5a389daed46a6d1f15dc1c10286b9fc015
parent690eb2025b98080d62f587bc511d6f88badfb848 (diff)
Exclude win32-utility from non-Windows builds
This gets rid of a warning about an empty object file.
-rw-r--r--butl/buildfile10
-rw-r--r--butl/win32-utility.cxx3
2 files changed, 11 insertions, 2 deletions
diff --git a/butl/buildfile b/butl/buildfile
index 4ac0672..0f45f42 100644
--- a/butl/buildfile
+++ b/butl/buildfile
@@ -22,8 +22,14 @@ lib{butl}: \
{hxx cxx}{ triplet } \
{hxx ixx }{ utility } \
{hxx }{ vector-view } \
-{hxx }{ version } \
-{hxx cxx}{ win32-utility }
+{hxx }{ version }
+
+# Exclude these from compilation on non-Windows targets.
+#
+if ($cxx.target.class == "windows")
+ lib{butl}: {hxx cxx}{ win32-utility }
+else
+ lib{butl}: file{ win32-utility win32-utility.cxx }
# This one is included into sha256.cxx so treat it as file to exclude
# from the compilation.
diff --git a/butl/win32-utility.cxx b/butl/win32-utility.cxx
index cf44d4d..a92d7e4 100644
--- a/butl/win32-utility.cxx
+++ b/butl/win32-utility.cxx
@@ -4,6 +4,9 @@
#include <butl/win32-utility>
+// Note that while we exclude it from the buildfile-based builds, we still
+// need these guards for build2 bootstrap.
+//
#ifdef _WIN32
#include <memory> // unique_ptr