From 9eba823269fffa8f1a5c780c937c202672b636fe Mon Sep 17 00:00:00 2001 From: Gabriel Hare Date: Wed, 14 Dec 2016 23:11:20 -0800 Subject: [PATCH 1/6] Demonstrate that compiler is identified as MSVC when VS2014 Clang extension is used --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7411bc..2d6c28c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,15 +11,19 @@ option(UTPP_AMPLIFY_WARNINGS "Set this to OFF if you wish to use CMake default warning levels; should generally only use to work around support issues for your specific compiler" ON) +message(STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}") if(MSVC14 OR MSVC12) + message(STATUS "Using MSVC compiler") # has the support we need else() include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) if(COMPILER_SUPPORTS_CXX14) + message(STATUS "Specify C++14") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") elseif(COMPILER_SUPPORTS_CXX11) + message(STATUS "Specify C++11") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") else() message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") From 8f7a2634462011b9b366704e480d25fe7fc2f626 Mon Sep 17 00:00:00 2001 From: Gabriel Hare Date: Thu, 15 Dec 2016 00:31:56 -0800 Subject: [PATCH 2/6] Increase CMake version to resolve developer warnings regarding implicit quoted dereference in STREQUAL comparison --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d6c28c..4f8c8db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.1) +cmake_minimum_required(VERSION 3.1.0) project(UnitTest++) option(UTPP_USE_PLUS_SIGN From c4ab9d31ed98da89bf1f07738129139eb0034dd8 Mon Sep 17 00:00:00 2001 From: Gabriel Hare Date: Thu, 15 Dec 2016 00:40:03 -0800 Subject: [PATCH 3/6] Identify Clang compiler when used as an MSVC extension --- CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f8c8db..000fd6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,22 +11,24 @@ option(UTPP_AMPLIFY_WARNINGS "Set this to OFF if you wish to use CMake default warning levels; should generally only use to work around support issues for your specific compiler" ON) -message(STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}") -if(MSVC14 OR MSVC12) - message(STATUS "Using MSVC compiler") - # has the support we need +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + # CHECK_CXX_COMPILER_FLAG could be used + # but MSVC version is preferred for feature requirements + if (MSVC14 OR MSVC12) + # has the support we need + else() + message(WARNING "The MSVC compiler version does not support required C++11 features. Please use a different C++ compiler.") + endif() else() include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG("-std=c++14" COMPILER_SUPPORTS_CXX14) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) if(COMPILER_SUPPORTS_CXX14) - message(STATUS "Specify C++14") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") elseif(COMPILER_SUPPORTS_CXX11) - message(STATUS "Specify C++11") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") else() - message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") + message(WARNING "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") endif() endif() From bb495391070e2a87503f9d3dba723b62a90a5032 Mon Sep 17 00:00:00 2001 From: Gabriel Hare Date: Thu, 15 Dec 2016 02:46:13 -0800 Subject: [PATCH 4/6] Revert "Increase CMake version to resolve developer warnings regarding implicit quoted dereference in STREQUAL comparison" This reverts commit 8f7a2634462011b9b366704e480d25fe7fc2f626. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 000fd6b..f075074 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1.0) +cmake_minimum_required(VERSION 2.8.1) project(UnitTest++) option(UTPP_USE_PLUS_SIGN From a2fe23887a793c42b35c7be54bd9e06023bc36b7 Mon Sep 17 00:00:00 2001 From: Gabriel Hare Date: Thu, 15 Dec 2016 02:50:09 -0800 Subject: [PATCH 5/6] =?UTF-8?q?Use=20=E2=80=9CMATCHES=E2=80=9D=20instead?= =?UTF-8?q?=20of=20=E2=80=9CSTREQUAL=E2=80=9D=20to=20avoid=20ambiguous=20c?= =?UTF-8?q?omparison.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit NOTE: Unlike STREQUAL this comparison is supported pre and post CMake v3.1.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f075074..4c39baf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ option(UTPP_AMPLIFY_WARNINGS "Set this to OFF if you wish to use CMake default warning levels; should generally only use to work around support issues for your specific compiler" ON) -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") +if(${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC") # CHECK_CXX_COMPILER_FLAG could be used # but MSVC version is preferred for feature requirements if (MSVC14 OR MSVC12) From 0b15459ee4fbee824c6a699d4c64fba8e49b8339 Mon Sep 17 00:00:00 2001 From: Gabriel Hare Date: Thu, 2 Feb 2017 21:56:48 -0800 Subject: [PATCH 6/6] Downgrade message to STATUS and do not declare C++11 as a requirement. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c39baf..2ed7b67 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,7 +17,7 @@ if(${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC") if (MSVC14 OR MSVC12) # has the support we need else() - message(WARNING "The MSVC compiler version does not support required C++11 features. Please use a different C++ compiler.") + message(STATUS "The MSVC compiler version does not support UnitTest++ C++11 features.") endif() else() include(CheckCXXCompilerFlag) @@ -28,7 +28,7 @@ else() elseif(COMPILER_SUPPORTS_CXX11) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") else() - message(WARNING "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.") + message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support.") endif() endif()