File tree Expand file tree Collapse file tree 2 files changed +17
-9
lines changed
Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ include(GNUInstallDirs)
44
55# Set C++ standard
66set (CMAKE_CXX_STANDARD 17)
7- #set(CMAKE_CXX_STANDARD_REQUIRED True)
7+ set (CMAKE_CXX_STANDARD_REQUIRED ON )
8+ set (CMAKE_CXX_EXTENSIONS OFF )
89#set(CMAKE_CXX_COMPILER "clang++")
910
1011# Set C standard (for TestAPI.c)
@@ -20,14 +21,16 @@ if(CONCURRENCY_DISABLED)
2021 add_definitions (-DCONCURRENCY_DISABLED )
2122endif ()
2223
23- set (COMMON_FLAGS "-Wall -Wextra -O3 -fomit-frame-pointer -fPIC -DNDEBUG -pedantic -march=native" )
24- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} -fno-rtti" )
25- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAGS} " )
26- set (SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR} /src" )
27-
2824if (MSVC )
29- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
25+ set (COMMON_FLAGS "/W4 /O2 /DNDEBUG" )
26+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} /GR-" )
27+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAGS} " )
28+ else ()
29+ set (COMMON_FLAGS "-Wall -Wextra -O3 -fomit-frame-pointer -fPIC -DNDEBUG -pedantic -march=native" )
30+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} -fno-rtti" )
31+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMMON_FLAGS} " )
3032endif ()
33+ set (SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR} /src" )
3134
3235# Source files
3336set (LIB_COMMON_SOURCES
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ limitations under the License.
157157 // __cplusplus always defaults to 199711L (aka C++98) !!! (unless
158158 // the extra option /Zc:__cplusplus is added to the command line).
159159 // Otherwise, using the _MSVC_LANG macro returns the proper C++ version.
160- #if __cplusplus >= 201103L
160+ #if ( __cplusplus >= 201103L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201103L)
161161 // C++ 11 or higher
162162 #define FINAL final
163163 #define NOEXCEPT noexcept
@@ -197,7 +197,12 @@ limitations under the License.
197197 #endif
198198 #endif
199199
200- #if !defined(nullptr)
200+ #if !defined(nullptr) && \
201+ ((defined (_MSC_VER) && (_MSC_VER < 1600 )) || \
202+ (defined (__GNUC__) && !defined (__clang__) && \
203+ ((__GNUC__ < 4 ) || ((__GNUC__ == 4 ) && (__GNUC_MINOR__ < 6 )))) || \
204+ (defined (__clang__) && \
205+ ((__clang_major__ < 3 ) || ((__clang_major__ == 3 ) && (__clang_minor__ < 1 )))))
201206 #define nullptr NULL
202207 #endif
203208 #endif
You can’t perform that action at this time.
0 commit comments