fix: use cpp-23

This commit is contained in:
tqcq
2025-09-09 17:55:56 +08:00
parent db53747d94
commit 432ca14c6e
3 changed files with 5 additions and 3 deletions

View File

@@ -2,7 +2,9 @@ cmake_minimum_required(VERSION 3.13)
project(redis-starter-cpp LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 11) # Enable the C++23 standard
if (NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11) # Enable the C++23 standard
endif()
set(THREADS_PREFER_PTHREAD_FLAG ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static -static-libgcc -static-libstdc++")

View File

@@ -8,4 +8,4 @@ debug: false
# on Codecrafters.
#
# Available versions: cpp-23
language_pack: cpp-11
language_pack: cpp-23

View File

@@ -14,7 +14,7 @@ set -e # Exit early if any commands fail
# - Edit .codecrafters/compile.sh to change how your program compiles remotely
(
cd "$(dirname "$0")" # Ensure compile steps are run within the repository directory
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake
cmake -B build -S . -DCMAKE_CXX_STANDARD=11 -DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake
cmake --build ./build
)