Skip to content

Commit 33869b5

Browse files
leoparenteclaude
andcommitted
fix: set CMAKE_CXX_STANDARD before project() for correct Conan profile on Windows
conan_provider.cmake fires during project() via CMAKE_PROJECT_TOP_LEVEL_INCLUDES, before the previous CMAKE_CXX_STANDARD=17 assignment at line 53. MSVC defaults to C++14, causing protobuf/6.33.5 (which requires C++17) to fail validation on Windows. Moving the standard declaration above project() ensures conan_provider.cmake always detects cppstd=17 regardless of platform. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 218c9ce commit 33869b5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
cmake_minimum_required(VERSION 3.24)
22

3+
# Must be set before project() so cmake/conan_provider.cmake (loaded via
4+
# CMAKE_PROJECT_TOP_LEVEL_INCLUDES) sees the correct standard and does not
5+
# fall back to MSVC's default of C++14 when generating the Conan profile.
6+
set(CMAKE_CXX_STANDARD 17)
7+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
8+
39
#######################################################
410
# VERSION
511
#######################################################

0 commit comments

Comments
 (0)