Skip to content

Commit d9df743

Browse files
committed
test MSVC /permissive with TOML_DISABLE_CONDITIONAL_NOEXCEPT_LAMBDA
Added "permissive" option to the ci matrix, for windows. Used `TOML_DISABLE_CONDITIONAL_NOEXCEPT_LAMBDA` to avoid the compile errors reported by Kevin Dick, Jan 19, 2024, at issue marzer#219
1 parent 5e46304 commit d9df743

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ jobs:
112112
type:
113113
- "debug"
114114
- "release"
115+
permissive:
116+
- false
117+
- true
115118

116119
runs-on: windows-2022
117120

@@ -130,7 +133,7 @@ jobs:
130133
- uses: ilammy/msvc-dev-cmd@v1
131134

132135
- name: Configure Meson
133-
run: meson setup build --vsenv --buildtype=${{ matrix.type }} -Ddevel=true -Db_lto=false
136+
run: meson setup build --vsenv --buildtype=${{ matrix.type }} -Ddevel=true -Db_lto=false -Dpermissive=${{ matrix.permissive }}
134137

135138
- name: Build
136139
run: meson compile -C build

meson.build

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ is_devel = get_option('devel')
3636
is_debug = get_option('debug')
3737
is_release = not is_debug
3838
is_pedantic = get_option('pedantic') or is_devel
39+
is_permissive = get_option('permissive')
3940
is_windows = host_machine.system() == 'windows'
4041
is_x64 = host_machine.cpu_family() == 'x86_64'
4142
is_subproject = meson.is_subproject()
@@ -75,7 +76,6 @@ global_args = cpp.get_supported_arguments(
7576
'/Gy', # function-level linking
7677
'/GF', # string pooling
7778
'/openmp-',
78-
'/permissive-',
7979
'/utf-8',
8080
'/volatile:iso',
8181
'/Zc:__cplusplus',
@@ -88,6 +88,11 @@ if has_exceptions
8888
else
8989
global_args += cpp.get_supported_arguments('-D_HAS_EXCEPTIONS=0')
9090
endif
91+
if is_permissive
92+
global_args += cpp.get_supported_arguments('/permissive', '-DTOML_DISABLE_CONDITIONAL_NOEXCEPT_LAMBDA=1')
93+
else
94+
global_args += cpp.get_supported_arguments('/permissive-')
95+
endif
9196
if is_pedantic
9297
global_args += cpp.get_supported_arguments(
9398
# clang

meson_options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ option('build_examples', type: 'boolean', value: false, description: 'Build the
44
option('build_tests', type: 'boolean', value: false, description: 'Build tests (default: false) (implied by devel)')
55
option('build_tt', type: 'boolean', value: false, description: 'Enable to build the toml-test encoder and decoder. (default: false) (implied by devel) (disabled by unreleased_features)')
66
option('pedantic', type: 'boolean', value: false, description: 'Enable as many compiler warnings as possible (default: false) (implied by devel)')
7+
option('permissive', type: 'boolean', value: false, description: 'Add compiler option /permissive (default: false, which implies /permissive-) (only relevant for MSVC)')
78
option('time_trace', type: 'boolean', value: false, description: 'Enable the -ftime-trace option (Clang only)')
89
option('unreleased_features', type: 'boolean', value: false, description: 'Enable TOML_UNRELEASED_FEATURES=1 (default: false) (only relevant when compiling the library)')
910

0 commit comments

Comments
 (0)