File tree Expand file tree Collapse file tree 2 files changed +24
-8
lines changed Expand file tree Collapse file tree 2 files changed +24
-8
lines changed
Original file line number Diff line number Diff line change @@ -3,6 +3,21 @@ project(UnitTest++)
3
3
4
4
option (UTPP_USE_PLUS_SIGN "Set this to OFF is you with to use '-cpp' instead of '++' in lib/include paths" ON )
5
5
6
+ if (MSVC14 OR MSVC12 )
7
+ # has the support we need
8
+ else ()
9
+ include (CheckCXXCompilerFlag )
10
+ CHECK_CXX_COMPILER_FLAG ("-std=c++14" COMPILER_SUPPORTS_CXX14 )
11
+ CHECK_CXX_COMPILER_FLAG ("-std=c++11" COMPILER_SUPPORTS_CXX11 )
12
+ if (COMPILER_SUPPORTS_CXX14 )
13
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14" )
14
+ elseif (COMPILER_SUPPORTS_CXX11 )
15
+ CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
16
+ else ()
17
+ message (STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler." )
18
+ endif ()
19
+ endif ()
20
+
6
21
# get the main sources
7
22
file (GLOB headers_ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} UnitTest++/*.h )
8
23
file (GLOB sources_ RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} UnitTest++/*.cpp )
Original file line number Diff line number Diff line change @@ -21,16 +21,17 @@ using namespace std;
21
21
#define _NOEXCEPT_OP (x )
22
22
#endif
23
23
#endif
24
-
25
- /* Test for GCC >= 4.8.0 */
26
- #ifdef __GNUC__
27
- #if (__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ > 7 ))
28
- #define _NOEXCEPT_OP (x ) noexcept (x)
29
- #else
30
- #define _NOEXCEPT_OP (x )
24
+
25
+ #ifndef __clang__
26
+ /* Test for GCC >= 4.8.0 */
27
+ #ifdef __GNUC__
28
+ #if (__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ > 7 ))
29
+ #define _NOEXCEPT_OP (x ) noexcept (x)
30
+ #else
31
+ #define _NOEXCEPT_OP (x )
32
+ #endif
31
33
#endif
32
34
#endif
33
-
34
35
#endif
35
36
36
37
namespace {
You can’t perform that action at this time.
0 commit comments