From 6b52de98393d3134eeb1e255a9ff5c07339daec8 Mon Sep 17 00:00:00 2001 From: James Xu Date: Wed, 5 Jun 2019 19:23:32 -0700 Subject: [PATCH 1/2] windows bringup --- ecl_build/cmake/ecl_cx11.cmake | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/ecl_build/cmake/ecl_cx11.cmake b/ecl_build/cmake/ecl_cx11.cmake index 67d8b99..2d00133 100644 --- a/ecl_build/cmake/ecl_cx11.cmake +++ b/ecl_build/cmake/ecl_cx11.cmake @@ -26,20 +26,32 @@ endmacro() # # Note, there are better ways of doing this in 3.1+. macro(ecl_enable_cxx11_compiler) - ecl_check_for_cxx11_compiler(CXX11_COMPILER_FOUND) - if(CXX11_COMPILER_FOUND) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + if (MSVC) + if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 11) + endif() else() - message(FATAL_ERROR "Requested cxx11 flags, but this compiler does not support it.") + ecl_check_for_cxx11_compiler(CXX11_COMPILER_FOUND) + if(CXX11_COMPILER_FOUND) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + else() + message(FATAL_ERROR "Requested cxx11 flags, but this compiler does not support it.") + endif() endif() endmacro() macro(ecl_enable_cxx0x_compiler) - ecl_check_for_cxx0x_compiler(CXX0X_COMPILER_FOUND) - if(CXX0X_COMPILER_FOUND) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + if (MSVC) + if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 11) + endif() else() - message(FATAL_ERROR "Requested cxx0x flags, but this compiler does not support it.") + ecl_check_for_cxx0x_compiler(CXX0X_COMPILER_FOUND) + if(CXX0X_COMPILER_FOUND) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + else() + message(FATAL_ERROR "Requested cxx0x flags, but this compiler does not support it.") + endif() endif() endmacro() From c7eb617115e392ee957ed36bcac6886c15c53eb8 Mon Sep 17 00:00:00 2001 From: James Xu Date: Fri, 7 Jun 2019 15:47:54 -0700 Subject: [PATCH 2/2] local update --- ecl_build/cmake/ecl_cx11.cmake | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/ecl_build/cmake/ecl_cx11.cmake b/ecl_build/cmake/ecl_cx11.cmake index 67d8b99..2d00133 100644 --- a/ecl_build/cmake/ecl_cx11.cmake +++ b/ecl_build/cmake/ecl_cx11.cmake @@ -26,20 +26,32 @@ endmacro() # # Note, there are better ways of doing this in 3.1+. macro(ecl_enable_cxx11_compiler) - ecl_check_for_cxx11_compiler(CXX11_COMPILER_FOUND) - if(CXX11_COMPILER_FOUND) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + if (MSVC) + if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 11) + endif() else() - message(FATAL_ERROR "Requested cxx11 flags, but this compiler does not support it.") + ecl_check_for_cxx11_compiler(CXX11_COMPILER_FOUND) + if(CXX11_COMPILER_FOUND) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + else() + message(FATAL_ERROR "Requested cxx11 flags, but this compiler does not support it.") + endif() endif() endmacro() macro(ecl_enable_cxx0x_compiler) - ecl_check_for_cxx0x_compiler(CXX0X_COMPILER_FOUND) - if(CXX0X_COMPILER_FOUND) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + if (MSVC) + if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 11) + endif() else() - message(FATAL_ERROR "Requested cxx0x flags, but this compiler does not support it.") + ecl_check_for_cxx0x_compiler(CXX0X_COMPILER_FOUND) + if(CXX0X_COMPILER_FOUND) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + else() + message(FATAL_ERROR "Requested cxx0x flags, but this compiler does not support it.") + endif() endif() endmacro()