Skip to content

Commit a3b5e04

Browse files
refactor: c++ 17 (#7038)
* Set cpp standard to 17 * Add missing `noexcept(false)` * Remove deprecated exception spec * Upgrade to catch v1.12.2: * Use `icu4c` on MacOS again * For Unit tests, Clear ghost-refs from old stack area
1 parent 2dba810 commit a3b5e04

File tree

11 files changed

+2273
-1085
lines changed

11 files changed

+2273
-1085
lines changed

.cirrus.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ task:
88
macos_instance:
99
image: ghcr.io/cirruslabs/macos-ventura-xcode
1010
Dependencies_script: brew install ninja icu4c && mkdir -p build
11-
CMake_script: cd build && cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DSTATIC_LIBRARY=ON -DEMBED_ICU=ON -DDISABLE_JIT=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..
11+
CMake_script: cd build && cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DSTATIC_LIBRARY=ON -DICU_INCLUDE_PATH=/opt/homebrew/opt/icu4c/include -DDISABLE_JIT=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..
1212
Build_script: cd build && ninja
1313
Test_script: cd build && ninja check
1414

@@ -17,7 +17,7 @@ task:
1717
macos_instance:
1818
image: ghcr.io/cirruslabs/macos-ventura-xcode
1919
Dependencies_script: brew install ninja icu4c && mkdir -p build
20-
CMake_script: cd build && cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DEMBED_ICU=ON -DDISABLE_JIT=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..
20+
CMake_script: cd build && cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DICU_INCLUDE_PATH=/opt/homebrew/opt/icu4c/include -DDISABLE_JIT=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..
2121
Build_script: cd build && ninja
2222
Test_script: cd build && ninja check
2323

@@ -26,6 +26,6 @@ task:
2626
macos_instance:
2727
image: ghcr.io/cirruslabs/macos-ventura-xcode
2828
Dependencies_script: brew install ninja icu4c && mkdir -p build
29-
CMake_script: cd build && cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DSTATIC_LIBRARY=ON -DEMBED_ICU=ON -DDISABLE_JIT=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..
29+
CMake_script: cd build && cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DSTATIC_LIBRARY=ON -DICU_INCLUDE_PATH=/opt/homebrew/opt/icu4c/include -DDISABLE_JIT=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ..
3030
Build_script: cd build && ninja
3131
Test_script: cd build && ninja check

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ cpp_new_line_before_catch = true
1414
cpp_new_line_before_else = true
1515

1616
# Xml files
17-
[*.xml]
17+
[*.{xml,props}]
1818
indent_size = 2

Build/Common.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
<PreprocessorDefinitions Condition="'$(ChakraVersionBuildCommit)'!=''">%(PreprocessorDefinitions);CHAKRA_VERSION_BUILD_COMMIT=$(ChakraVersionBuildCommit)</PreprocessorDefinitions>
9999
<PreprocessorDefinitions Condition="'$(ChakraVersionBuildDate)'!=''">%(PreprocessorDefinitions);CHAKRA_VERSION_BUILD_DATE=$(ChakraVersionBuildDate)</PreprocessorDefinitions>
100100

101-
101+
<LanguageStandard>stdcpp17</LanguageStandard>
102102
</ClCompile>
103103
<ResourceCompile>
104104
<PreprocessorDefinitions Condition="'$(ChakraVersionBuildNumber)'!=''">%(PreprocessorDefinitions);CHAKRA_VERSION_BUILD_NUMBER=$(ChakraVersionBuildNumber)</PreprocessorDefinitions>

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ if(CLR_CMAKE_PLATFORM_XPLAT)
372372
-D__STDC_WANT_LIB_EXT1__=1
373373
)
374374

375-
set(CMAKE_CXX_STANDARD 14)
375+
set(CMAKE_CXX_STANDARD 17)
376376
set(CMAKE_CXX_STANDARD_REQUIRED On)
377377

378378
# todo: fix general visibility of the interface

azure-pipelines.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ jobs:
8080
image_name: 'macOS-latest'
8181
deps: 'brew install ninja icu4c'
8282
build_type: 'RelWithDebInfo'
83-
libtype_flag: '-DEMBED_ICU=ON'
83+
libtype_flag: '-DICU_INCLUDE_PATH=/usr/local/opt/icu4c/include'
8484
OSX.Release:
8585
image_name: 'macOS-latest'
8686
deps: 'brew install ninja icu4c'
8787
build_type: 'Release'
88-
libtype_flag: '-DEMBED_ICU=ON'
88+
libtype_flag: '-DICU_INCLUDE_PATH=/usr/local/opt/icu4c/include'
8989

9090
pool:
9191
vmImage: $(image_name)

0 commit comments

Comments
 (0)