]> granicus.if.org Git - json-c/commitdiff
update testcase and delete debug -O0 build
authordota17 <chenguopingdota@163.com>
Mon, 2 Mar 2020 12:19:35 +0000 (20:19 +0800)
committerdota17 <chenguopingdota@163.com>
Mon, 2 Mar 2020 12:19:35 +0000 (20:19 +0800)
CMakeLists.txt
tests/test_deep_copy.c
tests/test_json_pointer.c

index 8e4fb2a62f3214b6e00e0da8de752cb6390b752c..0354553e8feb5528ce5481a99c80875b4fe2bc9b 100644 (file)
@@ -24,6 +24,8 @@ if(NOT CMAKE_BUILD_TYPE)
        set(CMAKE_BUILD_TYPE debug)
 endif()
 
+set(CMAKE_C_FLAGS_RELEASE   "${CMAKE_C_FLAGS_RELAESE} -O2")
+
 # Include file check macros honor CMAKE_REQUIRED_LIBRARIES
 # i.e. the check_include_file() calls will include -lm when checking.
 if(POLICY CMP0075)
@@ -243,9 +245,6 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC")
     set(CMAKE_C_FLAGS           "${CMAKE_C_FLAGS} /wd4701")
 endif()
 
-set(CMAKE_C_FLAGS_DEBUG     "${CMAKE_C_FLAGS_DEBUG} -O0")
-set(CMAKE_C_FLAGS_Release   "${CMAKE_C_FLAGS_Release} -O2")
-
 if (NOT ("${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC"))
        check_c_source_compiles(
        [=[
index 645b0ce805d6d204761c597e9c51fe103ff6758d..a91301521c171e384cdd6bd8856d6de2a30b3a24 100644 (file)
@@ -4,10 +4,8 @@
 #include <string.h>
 #ifdef NDEBUG
 #undef NDEBUG
-#include <assert.h>
-#else
-#include <assert.h>
 #endif
+#include <assert.h>
 #include <errno.h>
 #include <time.h>
 
index 9d4a54aa6298aaa8428bbcd59f515dcdc11168c7..f98a6a2cd2b1a179641b7ce19f697303cc80ab3c 100644 (file)
@@ -2,10 +2,8 @@
 #include "strerror_override_private.h"
 #ifdef NDEBUG
 #undef NDEBUG
-#include <assert.h>
-#else
-#include <assert.h>
 #endif
+#include <assert.h>
 #include <stdio.h>
 #include <string.h>