summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-10-06 21:47:28 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-10-06 21:47:28 +0300
commit65d67cc4d9ee4f8c74b3e516bf4478e2249f33c1 (patch)
tree1f4fed6a8cd7a2f2fbf75796039b176a79b043ea
parent1e53fa691949998dfa711878ecb7863814f085ee (diff)
Adapt for building with Clang on Windows
-rw-r--r--libpkgconf/build/root.build6
-rw-r--r--libpkgconf/libpkgconf/buildfile10
2 files changed, 11 insertions, 5 deletions
diff --git a/libpkgconf/build/root.build b/libpkgconf/build/root.build
index 5536426..ec33c38 100644
--- a/libpkgconf/build/root.build
+++ b/libpkgconf/build/root.build
@@ -11,8 +11,8 @@ using c
h{*}: extension = h
c{*}: extension = c
-if ($c.class == 'msvc')
-{
+if ($c.target.system == 'win32-msvc')
c.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
+
+if ($c.class == 'msvc')
c.coptions += /wd4251 /wd4275 /wd4800
-}
diff --git a/libpkgconf/libpkgconf/buildfile b/libpkgconf/libpkgconf/buildfile
index 0296e64..14603e6 100644
--- a/libpkgconf/libpkgconf/buildfile
+++ b/libpkgconf/libpkgconf/buildfile
@@ -10,7 +10,10 @@ bsd = ($tclass == 'bsd')
macos = ($tclass == 'macos')
windows = ($tclass == 'windows')
-msvc = ($c.class == 'msvc')
+msvc_runtime = ($c.target.system == 'win32-msvc')
+
+msvc = ($c.class == 'msvc')
+clang_msvc = ($c.id == 'clang' && $msvc_runtime)
# Assign variables for the PKG_DEFAULT_PATH, SYSTEM_INCLUDEDIR, and
# SYSTEM_LIBDIR macro definitions. The whole idea feels utterly broken (hello
@@ -86,6 +89,9 @@ c.poptions =+ "-I$out_root" "-I$src_root"
if $msvc
c.coptions += /wd4996 /wd4267
+if $clang_msvc
+ c.coptions += -Wno-deprecated-declarations
+
# Note: this should go last as it adds obj target-specific poptions.
#
if! $windows
@@ -120,7 +126,7 @@ else
objs{*}: c.poptions += -DLIBPKGCONF_EXPORT
obja{*}: c.poptions += -DPKGCONFIG_IS_STATIC
- c.libs += $regex.apply(advapi32, '(.+)', $msvc ? '\1.lib' : '-l\1')
+ c.libs += ($msvc_runtime ? advapi32.lib : -ladvapi32)
}
# Export options.