Skip to content

Commit

Permalink
Force static dependencies with --build-static
Browse files Browse the repository at this point in the history
This allows to run --build-static flag independently from
--with-static-examples to build shared library, python wrapper
and vamp plugins with static dependencies.

Fix linkage to static ffmpeg library.
  • Loading branch information
dbogdanov committed Aug 21, 2017
1 parent 177a922 commit 3c8aa4d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,14 @@ def configure(ctx):
# compile libgcc and libstd statically when using MinGW
ctx.env.CXXFLAGS = ['-static-libgcc', '-static-libstdc++']

elif ctx.options.WITH_STATIC_EXAMPLES and (sys.platform.startswith('linux') or sys.platform == 'darwin'):
print ("→ Compiling with static examples on Linux/OSX: search for pre-built dependencies in 'packaging/debian'")
elif ctx.options.BUILD_STATIC and (sys.platform.startswith('linux') or sys.platform == 'darwin'):
print ("→ Building static library on Linux/OSX: search for pre-built dependencies in 'packaging/debian'")
os.environ["PKG_CONFIG_PATH"] = 'packaging/debian_3rdparty/lib/pkgconfig'
os.environ["PKG_CONFIG_LIBDIR"] = os.environ["PKG_CONFIG_PATH"]

# flags required for linking to static ffmpeg libs
ctx.env.LINKFLAGS += ['-Wl,-Bsymbolic']
ctx.env.LDFLAGS += ['-Wl,-Bsymbolic']

ctx.load('compiler_cxx compiler_c')

Expand Down

0 comments on commit 3c8aa4d

Please sign in to comment.