0
0
mirror of https://github.com/zeromq/libzmq.git synced 2024-12-27 15:41:05 +08:00

Problem: need to check for C++ standard in cmake

Solution: use CheckCXXCompilerFlag to check for support for
-std=gnu++11
This commit is contained in:
Luca Boccassi 2016-02-19 21:48:43 +00:00
parent b9f1e3ed61
commit 80650ecfe2

View File

@ -5,6 +5,17 @@ project (ZeroMQ)
list (INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}") list (INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}")
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=gnu++11" COMPILER_SUPPORTS_CXX11)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
endif()
include(CheckCCompilerFlag)
CHECK_C_COMPILER_FLAG("-std=gnu11" COMPILER_SUPPORTS_C11)
if(COMPILER_SUPPORTS_C11)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu11")
endif()
option (WITH_OPENPGM "Build with support for OpenPGM" OFF) option (WITH_OPENPGM "Build with support for OpenPGM" OFF)
option (WITH_VMCI "Build with support for VMware VMCI socket" OFF) option (WITH_VMCI "Build with support for VMware VMCI socket" OFF)