Skip to content

Commit 8f77c78

Browse files
committed
meson: Set default visibility to hidden, if supported
1 parent 534b59e commit 8f77c78

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

meson.build

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,17 @@ install_headers(
4646
jsoncpp_headers,
4747
subdir : 'json')
4848

49-
if get_option('default_library') == 'shared' and meson.get_compiler('cpp').get_id() == 'msvc'
50-
dll_export_flag = '-DJSON_DLL_BUILD'
51-
dll_import_flag = '-DJSON_DLL'
49+
if get_option('default_library') == 'shared'
50+
dll_export_flag = ['-DJSON_DLL_BUILD']
51+
dll_import_flag = ['-DJSON_DLL']
5252
else
5353
dll_export_flag = []
5454
dll_import_flag = []
5555
endif
5656

57+
cpp = meson.get_compiler('cpp')
58+
dll_export_flag += [cpp.first_supported_argument('-fvisibility=hidden')]
59+
5760
jsoncpp_lib = library(
5861
'jsoncpp',
5962
[ jsoncpp_gen_sources,

0 commit comments

Comments
 (0)