From: dota17 Date: Mon, 2 Mar 2020 12:19:35 +0000 (+0800) Subject: update testcase and delete debug -O0 build X-Git-Tag: json-c-0.14-20200419~50^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e56ab0146f9a30e2d5deec2cccf195ed13abc1c4;p=json-c update testcase and delete debug -O0 build --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e4fb2a..0354553 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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( [=[ diff --git a/tests/test_deep_copy.c b/tests/test_deep_copy.c index 645b0ce..a913015 100644 --- a/tests/test_deep_copy.c +++ b/tests/test_deep_copy.c @@ -4,10 +4,8 @@ #include #ifdef NDEBUG #undef NDEBUG -#include -#else -#include #endif +#include #include #include diff --git a/tests/test_json_pointer.c b/tests/test_json_pointer.c index 9d4a54a..f98a6a2 100644 --- a/tests/test_json_pointer.c +++ b/tests/test_json_pointer.c @@ -2,10 +2,8 @@ #include "strerror_override_private.h" #ifdef NDEBUG #undef NDEBUG -#include -#else -#include #endif +#include #include #include