Skip to content

Commit

Permalink
Set default language version through variable
Browse files Browse the repository at this point in the history
Use CMake reserved variable to specify default C++ language version,
so version can be adjust later by each target accordingly.
  • Loading branch information
wdhongtw committed Feb 22, 2025
1 parent e9b99b9 commit 247fc0f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ add_definitions(
-DPACKAGE_NAME="${PACKAGE_NAME}"
)

set(CMAKE_CXX_STANDARD 14) # default C++ version for new target afterward
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
add_definitions(
-std=c++14
-Wall
)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
Expand All @@ -163,7 +163,6 @@ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
endif ()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_definitions(
-std=c++14
-Wall
)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread")
Expand Down

0 comments on commit 247fc0f

Please sign in to comment.