Skip to content

Commit

Permalink
♻️ do not globally set the C++ standard
Browse files Browse the repository at this point in the history
modern CMake uses target based properties and features
  • Loading branch information
burgholzer committed Aug 6, 2024
1 parent 2cf451a commit 18c42bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ project(ldpc
DESCRIPTION "ldpc - Software for classical and quantum low density parity check codes"
LANGUAGES CXX)

# Set the C++ standard to C++20 for this project
set(CMAKE_CXX_STANDARD 20)

# Enable OpenMP support for parallel programming
# SET(CMAKE_CXX_FLAGS "-fopenmp")

Expand All @@ -31,6 +28,9 @@ add_library(ldpc INTERFACE)
# Add specific directories to the include path for any target that links with the 'ldpc' library
target_include_directories(ldpc INTERFACE src_cpp include/robin_map include/rapidcsv)

# Set the required C++ standard
target_compile_features(ldpc INTERFACE cxx_std_20)

if (LDPC_MASTER_PROJECT)
add_subdirectory(cpp_example)
endif()
Expand Down

0 comments on commit 18c42bf

Please sign in to comment.