Skip to content

Commit

Permalink
Merge pull request #2023 from HaoZeke/tk3_scipy
Browse files Browse the repository at this point in the history
BLD: Silence all warnings in SciPy
  • Loading branch information
jajhall authored Nov 4, 2024
2 parents c651664 + 989a88c commit 5bce0d6
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 17 deletions.
57 changes: 47 additions & 10 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,54 @@ host_system = host_machine.system()
is_windows = host_system == 'windows'
is_mingw = is_windows and cc.get_id() == 'gcc'

# Granular flags
# C++
_cpp_Wno_invalid_offsetof = cppc.get_supported_arguments('-Wno-invalid-offsetof')
_cpp_Wno_maybe_uninitialized = cppc.get_supported_arguments('-Wno-maybe-uninitialized')
_cpp_Wno_reorder = cppc.get_supported_arguments('-Wno-reorder')
_cpp_Wno_reorder_ctor = cppc.get_supported_arguments('-Wno-reorder-ctor')
_cpp_Wno_sometimes_uninitialized = cppc.get_supported_arguments('-Wno-sometimes-uninitialized')
_cpp_Wno_unused_but_set_variable = cppc.get_supported_arguments('-Wno-unused-but-set-variable')
_cpp_Wno_unused_variable = cppc.get_supported_arguments('-Wno-unused-variable')
_cpp_Wno_use_after_free = cppc.get_supported_arguments('-Wno-use-after-free')
_cpp_Wno_comment = cppc.get_supported_arguments('-Wno-comment')


# C
Wno_comment = cc.get_supported_arguments('-Wno-comment')
Wno_invalid_offsetof = cc.get_supported_arguments('-Wno-invalid-offsetof')
Wno_maybe_uninitialized = cc.get_supported_arguments('-Wno-maybe-uninitialized')
Wno_sometimes_uninitialized = cc.get_supported_arguments('-Wno-sometimes-uninitialized')
Wno_unused_label = cc.get_supported_arguments('-Wno-unused-label')
Wno_use_after_free = cc.get_supported_arguments('-Wno-use-after-free')
Wno_unused_but_set_variable = cc.get_supported_arguments('-Wno-unused-but-set-variable')
Wno_unused_variable = cc.get_supported_arguments('-Wno-unused-variable')
Wno_use_after_free = cc.get_supported_arguments('-Wno-use-after-free')

# Conditional arguments
_args += cppc.get_supported_arguments([
'-Wno-return-type',
'-Wno-switch',
'-Wno-comment',
'-Wno-unused-variable',
'-Wno-unused-but-set-variable',
'-Wno-unused-const-variable',
'-Wno-unused-function',
'-Wno-unused-label',
])
_highs_cpp_suppressions = [
_cpp_Wno_comment,
_cpp_Wno_invalid_offsetof,
_cpp_Wno_maybe_uninitialized,
_cpp_Wno_reorder,
_cpp_Wno_reorder_ctor,
_cpp_Wno_sometimes_uninitialized,
_cpp_Wno_unused_but_set_variable,
_cpp_Wno_unused_variable,
_cpp_Wno_use_after_free,
]

_highs_c_suppressions = [
Wno_comment,
Wno_invalid_offsetof,
Wno_maybe_uninitialized,
Wno_sometimes_uninitialized,
Wno_unused_but_set_variable,
Wno_unused_label,
Wno_unused_variable,
Wno_use_after_free,
]


if cppc.get_id() == 'msvc'
add_project_arguments(
Expand Down
13 changes: 6 additions & 7 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ _srcs = [
]

highslib_srcs = [
highs_conf_file,
files(_srcs),
files(_cupdlp_srcs),
files(_basiclu_srcs),
Expand All @@ -322,10 +321,10 @@ do_install = get_option('do_install')

if not get_option('with_pybind11')
highslib = library('highs',
highslib_srcs,
highslib_srcs + highs_conf_file,
dependencies: _deps,
cpp_args: _args,
c_args: _args,
cpp_args: _highs_cpp_suppressions + _args,
c_args: _highs_c_suppressions + _args,
include_directories: _incdirs,
gnu_symbol_visibility: symbol_visibility,
pic: true,
Expand Down Expand Up @@ -379,10 +378,10 @@ if get_option('with_pybind11')
py = import('python').find_installation(pure: false)

highslib = library('highs',
highslib_srcs,
highslib_srcs + highs_conf_file,
dependencies: _deps,
cpp_args: _args,
c_args: _args,
cpp_args: _highs_cpp_suppressions + _args,
c_args: _highs_c_suppressions + _args,
include_directories: _incdirs,
gnu_symbol_visibility: symbol_visibility,
pic: true,
Expand Down

0 comments on commit 5bce0d6

Please sign in to comment.