diff options
author | Mauro Sardara <msardara+fdio@cisco.com> | 2017-10-17 15:17:50 +0200 |
---|---|---|
committer | Mauro Sardara <msardara+fdio@cisco.com> | 2017-10-17 15:17:50 +0200 |
commit | 49ff69a0c3f33b03b2ebaac9098d6e8c88a5e8b6 (patch) | |
tree | c2456ef04112400ad23d739fce75109685de0378 | |
parent | 40418e3e4261cad4cb57b7b40e46bf2fdbf8c77b (diff) |
Removing LongBow asserts in release build.
Change-Id: Ia554a5f2bbf6e226652b93dfb6ae2a9f072003cc
Signed-off-by: Mauro Sardara <msardara+fdio@cisco.com>
-rw-r--r-- | libparc/CMakeLists.txt | 4 | ||||
-rw-r--r-- | longbow/CMakeLists.txt | 20 |
2 files changed, 16 insertions, 8 deletions
diff --git a/libparc/CMakeLists.txt b/libparc/CMakeLists.txt index defa060a..b3ebc2aa 100644 --- a/libparc/CMakeLists.txt +++ b/libparc/CMakeLists.txt @@ -35,7 +35,7 @@ else() endif() set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS}") -set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS} -DPARCLibrary_DISABLE_VALIDATION") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS} -DPARCLibrary_DISABLE_VALIDATION -DLongBow_DISABLE_ASSERTIONS") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${CMAKE_C_FLAGS}") set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${CMAKE_C_FLAGS}") @@ -84,7 +84,7 @@ if (ANDROID_API) message("Android build: Skipping test ${ARGV0}") endmacro(AddTest) elseif(COMPILE_FOR_IOS) - macro(AddTest testFile) + macro(AddTest testFile) message("iOS build: Skipping test ${ARGV0}") endmacro(AddTest) else() diff --git a/longbow/CMakeLists.txt b/longbow/CMakeLists.txt index 20fc9c0b..ac34f8b5 100644 --- a/longbow/CMakeLists.txt +++ b/longbow/CMakeLists.txt @@ -64,12 +64,25 @@ elseif(COMPILE_FOR_IOS) message("############ Detected cross compile for ${CMAKE_SYSTEM_NAME}") message("############ This build will not include doxygen, tools, or tests") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") + + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS}") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS} -DLongBow_DISABLE_ASSERTIONS") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${CMAKE_C_FLAGS}") + set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${CMAKE_C_FLAGS}") + macro(AddTest testFile) message("IOS build: Skipping test ${ARGV0}") endmacro(AddTest) add_subdirectory(src) else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_GNU_SOURCE") + + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS}") + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS} -DLongBow_DISABLE_ASSERTIONS") + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${CMAKE_C_FLAGS}") + set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${CMAKE_C_FLAGS}") + macro(AddTest testFile) add_executable(${ARGV0} ${ARGV0}.c) target_link_libraries(${ARGV0} ${PARC_BIN_LIBRARIES}) @@ -81,11 +94,6 @@ else() add_subdirectory(documentation) endif() -set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS}") -set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS}") -set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${CMAKE_C_FLAGS}") -set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${CMAKE_C_FLAGS}") - # Generate DEB / RPM packages option(DEB_PACKAGE "Create deb package" OFF) @@ -163,4 +171,4 @@ set(CPACK_${TYPE}_PACKAGE_VENDOR ${VENDOR}) set(CPACK_${TYPE}_PACKAGE_DESCRIPTION "Runtime and testing framework for C applications.") set(CPACK_${TYPE}_PACKAGE_HOMEPAGE "https://wiki.fd.io/view/Cframework") -include(CPack)
\ No newline at end of file +include(CPack) |