Skip to content
Permalink
Browse files

meson,woe32: prevent static dependencies from using dllimport

boxfort and nanomsg needs -DBXF_STATIC_LIB and -DNN_STATIC_LIB
respectively, so that it doesn't add dllimport to api functions.

Not doing so fails the build with baffling linker errors on Windows
systems.
  • Loading branch information
Snaipe committed Dec 30, 2019
1 parent 7bd3df2 commit 3008b59c71a7d3ae7d68432acb05409f2207645a
Showing with 5 additions and 2 deletions.
  1. +4 −1 meson.build
  2. +1 −1 subprojects/boxfort.wrap
@@ -160,6 +160,9 @@ if not nanomsg.found()
cc.find_library('ws2_32', required: false),
cc.find_library('mswsock', required: false),
]

# Required on windows to avoid symbols being dllimport-ed on a static lib
add_project_arguments('-DNN_STATIC_LIB', language: ['c', 'cpp'])
else
config.set('NN_H', '<nanomsg/nn.h>')
config.set('NN_REQREP_H', '<nanomsg/reqrep.h>')
@@ -187,7 +190,7 @@ if not libgit2.found()
libgit2 = libgit2_proj.dependency('git2')
endif

boxfort = dependency('boxfort', fallback: ['boxfort', 'boxfort_dep'])
boxfort = dependency('boxfort', fallback: ['boxfort', 'boxfort'])
libffi = dependency('libffi', required: get_option('theories'), fallback: ['libffi', 'ffi_dep'])

config.set('ENABLE_THEORIES', libffi.found())
@@ -1,4 +1,4 @@
[wrap-git]
directory = boxfort
url = https://github.com/Snaipe/BoxFort.git
revision = 0810ddb00c4e1c47b73ee3ec6f116b2eb74bf671
revision = 1f0c6e94a8e5279389b209477faa333752ff5298

0 comments on commit 3008b59

Please sign in to comment.
You can’t perform that action at this time.