From d678291f48f5f5f300ceb0e87baf3894b58fac3e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 21 Oct 2020 14:48:23 +0200 Subject: Fix building with clang on Windows --- include/pugl/detail/types.h | 2 +- wscript | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/pugl/detail/types.h b/include/pugl/detail/types.h index edd2bd0..e18eb87 100644 --- a/include/pugl/detail/types.h +++ b/include/pugl/detail/types.h @@ -31,7 +31,7 @@ // Unused parameter macro to suppresses warnings and make it impossible to use #if defined(__cplusplus) # define PUGL_UNUSED(name) -#elif defined(__GNUC__) +#elif defined(__GNUC__) || defined(__clang__) # define PUGL_UNUSED(name) name##_unused __attribute__((__unused__)) #else # define PUGL_UNUSED(name) name diff --git a/wscript b/wscript index 5fa55c3..a5c86bf 100644 --- a/wscript +++ b/wscript @@ -131,6 +131,9 @@ def configure(conf): '-Wno-conversion', '-Wno-format', '-Wno-suggest-attribute=format'], + 'clang': ['-D_CRT_SECURE_NO_WARNINGS', + '-Wno-format-nonliteral', + '-Wno-nonportable-system-include-path'], }) elif conf.env.TARGET_PLATFORM == 'darwin': autowaf.add_compiler_flags(conf.env, '*', { @@ -311,7 +314,9 @@ def build(bld): flags = [] if not bld.env.MSVC_COMPILER: - flags = ['-fPIC', '-fvisibility=hidden'] + flags = ['-fvisibility=hidden'] + if bld.env.TARGET_PLATFORM != 'win32': + flags = ['-fPIC'] if bld.env.BUILD_SHARED: bld(features = 'c cshlib', -- cgit v1.2.1