aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-04-19 19:46:20 +0200
committerDavid Robillard <d@drobilla.net>2020-04-19 19:46:20 +0200
commit14e959b06b5f167b0406772fc0ee8e2111eb4613 (patch)
tree4dd99227edddc0a0f455732fde72bdd82520b5b1
parent256e75d9151ff88243f7e91cca091549dd4a6315 (diff)
downloadpugl-14e959b06b5f167b0406772fc0ee8e2111eb4613.tar.gz
pugl-14e959b06b5f167b0406772fc0ee8e2111eb4613.tar.bz2
pugl-14e959b06b5f167b0406772fc0ee8e2111eb4613.zip
Set library flags on targets only instead of globally
-rw-r--r--wscript24
1 files changed, 14 insertions, 10 deletions
diff --git a/wscript b/wscript
index 8385e40..bf4596d 100644
--- a/wscript
+++ b/wscript
@@ -63,8 +63,6 @@ def configure(conf):
if conf.env.MSVC_COMPILER:
append_cflags(['/wd4191', '/wd4355'])
else:
- conf.env.append_unique('LINKFLAGS', ['-fvisibility=hidden'])
- append_cflags(['-fvisibility=hidden'])
if Options.options.ultra_strict:
append_cflags(['-Wunused-parameter', '-Wno-pedantic'])
@@ -221,18 +219,24 @@ def build(bld):
'install_path': '${LIBDIR}',
'vnum': PUGL_VERSION})
+ flags = [] if bld.env.MSVC_COMPILER else ['-fPIC', '-fvisibility=hidden']
+
if bld.env.BUILD_SHARED:
- bld(features = 'c cshlib',
- name = name,
- target = 'pugl_%s-%s' % (name, PUGL_MAJOR_VERSION),
- defines = ['PUGL_INTERNAL', 'PUGL_SHARED'],
+ bld(features = 'c cshlib',
+ name = name,
+ target = 'pugl_%s-%s' % (name, PUGL_MAJOR_VERSION),
+ defines = ['PUGL_INTERNAL', 'PUGL_SHARED'],
+ cflags = flags,
+ linkflags = flags,
**args)
if bld.env.BUILD_STATIC:
- bld(features = 'c cstlib',
- name = 'pugl_%s_static' % name,
- target = 'pugl_%s-%s' % (name, PUGL_MAJOR_VERSION),
- defines = ['PUGL_INTERNAL', 'PUGL_DISABLE_DEPRECATED'],
+ bld(features = 'c cstlib',
+ name = 'pugl_%s_static' % name,
+ target = 'pugl_%s-%s' % (name, PUGL_MAJOR_VERSION),
+ defines = ['PUGL_INTERNAL', 'PUGL_DISABLE_DEPRECATED'],
+ cflags = flags,
+ linkflags = flags,
**args)
def build_platform(platform, **kwargs):