Skip to content

Commit 7a7f990

Browse files
committed
draft (don't merge): add "permissive" option to ci matrix
1 parent 5e46304 commit 7a7f990

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
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: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ project(
1818
'b_lto=false',
1919
'b_ndebug=if-release',
2020
# compiler options
21-
'cpp_std=c++17'
21+
'cpp_std=c++17',
22+
'permissive=false'
2223
]
2324
)
2425

@@ -36,6 +37,7 @@ is_devel = get_option('devel')
3637
is_debug = get_option('debug')
3738
is_release = not is_debug
3839
is_pedantic = get_option('pedantic') or is_devel
40+
is_permissive = get_option('permissive')
3941
is_windows = host_machine.system() == 'windows'
4042
is_x64 = host_machine.cpu_family() == 'x86_64'
4143
is_subproject = meson.is_subproject()
@@ -75,7 +77,6 @@ global_args = cpp.get_supported_arguments(
7577
'/Gy', # function-level linking
7678
'/GF', # string pooling
7779
'/openmp-',
78-
'/permissive-',
7980
'/utf-8',
8081
'/volatile:iso',
8182
'/Zc:__cplusplus',
@@ -88,6 +89,11 @@ if has_exceptions
8889
else
8990
global_args += cpp.get_supported_arguments('-D_HAS_EXCEPTIONS=0')
9091
endif
92+
if is_permissive
93+
global_args += cpp.get_supported_arguments('/permissive') # TODO '-DTOML_DISABLE_CONDITIONAL_NOEXCEPT_LAMBDA=1')
94+
else
95+
global_args += cpp.get_supported_arguments('/permissive-')
96+
endif
9197
if is_pedantic
9298
global_args += cpp.get_supported_arguments(
9399
# 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)