diff options
author | David Robillard <d@drobilla.net> | 2020-04-19 19:46:20 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-04-19 19:46:20 +0200 |
commit | 14e959b06b5f167b0406772fc0ee8e2111eb4613 (patch) | |
tree | 4dd99227edddc0a0f455732fde72bdd82520b5b1 | |
parent | 256e75d9151ff88243f7e91cca091549dd4a6315 (diff) | |
download | pugl-14e959b06b5f167b0406772fc0ee8e2111eb4613.tar.gz pugl-14e959b06b5f167b0406772fc0ee8e2111eb4613.tar.bz2 pugl-14e959b06b5f167b0406772fc0ee8e2111eb4613.zip |
Set library flags on targets only instead of globally
-rw-r--r-- | wscript | 24 |
1 files changed, 14 insertions, 10 deletions
@@ -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): |