Build system / Meson: hack for static linking under Windows

[skip ci]
master
Sébastien Villemot 2023-07-28 14:01:29 +02:00
parent dcb8b50cf8
commit c8cd182e98
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 12 additions and 1 deletions

View File

@ -58,7 +58,18 @@ preprocessor_src = [ 'ComputingTasks.cc',
'macro/Expressions.cc',
'macro/Directives.cc' ]
if get_option('prefer_static')
preprocessor_link_args = [ '-static-libgcc', '-static-libstdc++' ]
if host_machine.system() == 'windows'
# See comment in rules for MEX files
preprocessor_link_args += [ '-Wl,-Bstatic', '-lssp', '-Wl,-Bdynamic',
'-Wl,-Bstatic,--whole-archive', '-lwinpthread', '-Wl,-Bdynamic,--no-whole-archive' ]
endif
else
preprocessor_link_args = []
endif
executable('dynare-preprocessor', preprocessor_src, flex_src, flexlexer_h, bison_src,
include_directories : preprocessor_incdir, dependencies : boost_dep,
link_args : get_option('prefer_static') ? '-static' : '',
link_args : preprocessor_link_args,
install : true)