mirror of
https://github.com/zeromq/libzmq.git
synced 2025-01-14 01:37:56 +08:00
Problem: newer cmake versions set CMAKE_C(XX)_FLAGS at a later stage not allowing a user to override the standard
Solution: check for C(XX)_STANDARD/CMAKE_C(XX)_STANDARD as well Fixes #4284
This commit is contained in:
parent
519e2bf129
commit
c036d66286
@ -111,14 +111,14 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT MSVC)
|
if (NOT MSVC)
|
||||||
if(NOT CMAKE_CXX_FLAGS MATCHES "-std=")
|
if(NOT CMAKE_CXX_FLAGS MATCHES "-std=" AND NOT CXX_STANDARD AND NOT CMAKE_CXX_STANDARD)
|
||||||
# use C++11 by default if supported
|
# use C++11 by default if supported
|
||||||
check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
||||||
if(COMPILER_SUPPORTS_CXX11)
|
if(COMPILER_SUPPORTS_CXX11)
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if(NOT CMAKE_C_FLAGS MATCHES "-std=")
|
if(NOT CMAKE_C_FLAGS MATCHES "-std=" AND NOT C_STANDARD AND NOT CMAKE_C_STANDARD)
|
||||||
check_c_compiler_flag("-std=c11" COMPILER_SUPPORTS_C11)
|
check_c_compiler_flag("-std=c11" COMPILER_SUPPORTS_C11)
|
||||||
if(COMPILER_SUPPORTS_C11)
|
if(COMPILER_SUPPORTS_C11)
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user