Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
cmake_minimum_required(VERSION 3.15)
project(CloudStreamingArgsDebugger LANGUAGES CXX)

# Use C++20 project-wide. The GitHub Actions build.yml invokes cl with
# /std:c++20 directly; keep the CMake path in sync so the two build modes
# compile the same language.
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# Specify that this is a Win32 application with wWinMain entry point
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")

Expand Down
2 changes: 0 additions & 2 deletions path_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ template <typename Fill> std::wstring FillWithGrowingBuffer(Fill fill)
for (int attempt = 0; attempt < 6; ++attempt)
{
SetLastError(ERROR_SUCCESS);
// `&buf[0]` yields `wchar_t*` in both C++17 and C++20; `buf.data()`
// would only do so in C++20. Tests compile with C++17.
DWORD len = fill(&buf[0], static_cast<DWORD>(buf.size()));
if (len == 0)
return {};
Expand Down
6 changes: 4 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ project(ArgumentDebuggerTests LANGUAGES CXX)
# Explicitly specify that tests are console applications
set(CMAKE_WIN32_EXECUTABLE OFF)

# Set C++ standard
set(CMAKE_CXX_STANDARD 17)
# Set C++ standard (kept in sync with the top-level CMakeLists.txt and with
# the /std:c++20 flag used by .github/workflows/build.yml).
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# Find GoogleTest package
find_package(GTest CONFIG REQUIRED)
Expand Down
Loading