mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-08 06:00:54 +00:00
build: cleanup visibility for symbols
This commit is contained in:
31
meson.build
31
meson.build
@ -32,6 +32,20 @@ config_h.set('PACKAGE_TARNAME', 'PACKAGE_STRING')
|
|||||||
config_h.set('PACKAGE', 'PACKAGE_NAME')
|
config_h.set('PACKAGE', 'PACKAGE_NAME')
|
||||||
config_h.set('VERSION', 'PACKAGE_VERSION')
|
config_h.set('VERSION', 'PACKAGE_VERSION')
|
||||||
|
|
||||||
|
# Detect and set symbol visibility
|
||||||
|
if get_option('default_library') != 'static'
|
||||||
|
if host_machine.system() == 'windows'
|
||||||
|
config_h.set('DLL_EXPORT', true)
|
||||||
|
if cc.get_id() == 'msvc'
|
||||||
|
config_h.set('_SYSPROF_EXTERN', '__declspec(dllexport) extern')
|
||||||
|
elif cc.has_argument('-fvisibility=hidden')
|
||||||
|
config_h.set('_SYSPROF_EXTERN', '__attribute__((visibility("default"))) __declspec(dllexport) extern')
|
||||||
|
endif
|
||||||
|
elif cc.has_argument('-fvisibility=hidden')
|
||||||
|
config_h.set('_SYSPROF_EXTERN', '__attribute__((visibility("default"))) extern')
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
if get_option('with_sysprofd') != 'none'
|
if get_option('with_sysprofd') != 'none'
|
||||||
config_h.set10('ENABLE_POLKIT', true)
|
config_h.set10('ENABLE_POLKIT', true)
|
||||||
endif
|
endif
|
||||||
@ -103,23 +117,6 @@ foreach arg: test_c_args
|
|||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
# Detect and set symbol visibility
|
|
||||||
hidden_visibility_args = []
|
|
||||||
if get_option('default_library') != 'static'
|
|
||||||
if host_machine.system() == 'windows'
|
|
||||||
config_h.set('DLL_EXPORT', true)
|
|
||||||
if cc.get_id() == 'msvc'
|
|
||||||
config_h.set('_SP_EXTERN', '__declspec(dllexport) extern')
|
|
||||||
elif cc.has_argument('-fvisibility=hidden')
|
|
||||||
config_h.set('_SP_EXTERN', '__attribute__((visibility("default"))) __declspec(dllexport) extern')
|
|
||||||
hidden_visibility_args = ['-fvisibility=hidden']
|
|
||||||
endif
|
|
||||||
elif cc.has_argument('-fvisibility=hidden')
|
|
||||||
config_h.set('_SP_EXTERN', '__attribute__((visibility("default"))) extern')
|
|
||||||
hidden_visibility_args = ['-fvisibility=hidden']
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
add_project_arguments(global_c_args, language: 'c')
|
add_project_arguments(global_c_args, language: 'c')
|
||||||
|
|
||||||
release_flags = []
|
release_flags = []
|
||||||
|
|||||||
Reference in New Issue
Block a user