From 65d67cc4d9ee4f8c74b3e516bf4478e2249f33c1 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Sun, 6 Oct 2019 21:47:28 +0300 Subject: Adapt for building with Clang on Windows --- libpkgconf/build/root.build | 6 +++--- libpkgconf/libpkgconf/buildfile | 10 ++++++++-- 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. -- cgit v1.1