mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-26 06:41:03 +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()
|
||||
|
||||
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
|
||||
check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
||||
if(COMPILER_SUPPORTS_CXX11)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
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)
|
||||
if(COMPILER_SUPPORTS_C11)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11")
|
||||
|
Loading…
x
Reference in New Issue
Block a user