mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Amend 39996524
: Satisfy older cmake versions
This commit is contained in:
parent
afdda7c9e1
commit
6869c3adff
@ -699,15 +699,22 @@ else()
|
||||
# Try to find a std-cxx-feature supported by this cmake version
|
||||
while (std_num GREATER 0)
|
||||
list(FIND CMAKE_CXX_COMPILE_FEATURES "cxx_std_${std_num}" stdfeature)
|
||||
if (stdfeature GREATER_EQUAL 0)
|
||||
if (stdfeature GREATER -1)
|
||||
set(CMAKE_CXX_STANDARD ${std_num})
|
||||
break()
|
||||
endif()
|
||||
math(EXPR std_num "${std_num}-1")
|
||||
endwhile()
|
||||
|
||||
message(STATUS "std_num = ${std_num}")
|
||||
if (std_num EQUAL 0)
|
||||
# not found appropriate feature
|
||||
# so we use LYX_GCC11_MODE
|
||||
set(LYX_CXX_FLAGS "-Wall -Wunused-parameter ${LYX_GCC11_MODE}${LYX_CXX_FLAGS}")
|
||||
else()
|
||||
message(STATUS "CMAKE_CXX_STANDARD set to ${CMAKE_CXX_STANDARD}")
|
||||
set(LYX_CXX_FLAGS "-Wall -Wunused-parameter ${LYX_CXX_FLAGS}")
|
||||
endif()
|
||||
message(STATUS "Setting LYX_CXX_FLAGS to ${LYX_CXX_FLAGS}")
|
||||
else()
|
||||
set(LYX_CXX_FLAGS "-Wall -Wunused-parameter ${LYX_GCC11_MODE}${LYX_CXX_FLAGS}")
|
||||
endif()
|
||||
|
@ -54,6 +54,7 @@ else()
|
||||
endif()
|
||||
else()
|
||||
set(CXX11_FLAG_CANDIDATES
|
||||
"--std=c++20"
|
||||
"--std=c++17"
|
||||
"--std=c++14"
|
||||
"--std=c++11"
|
||||
|
Loading…
Reference in New Issue
Block a user