From e1a111ad09d74a5b683635000e34bcc38c717d45 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Sun, 7 May 2017 03:03:40 -0700 Subject: [PATCH] [dlib] Dlib encodes debug/release in its config.h. Patch it to respond to the NDEBUG macro instead. --- ports/dlib/CONTROL | 2 +- ports/dlib/portfile.cmake | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ports/dlib/CONTROL b/ports/dlib/CONTROL index 952e267ae5a..a6e886c4aee 100644 --- a/ports/dlib/CONTROL +++ b/ports/dlib/CONTROL @@ -1,4 +1,4 @@ Source: dlib -Version: 19.4-2 +Version: 19.4-3 Build-Depends: libjpeg-turbo, libpng, sqlite3, fftw3 Description: Modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ diff --git a/ports/dlib/portfile.cmake b/ports/dlib/portfile.cmake index 47fbb7ea7ba..2a5ae6f4473 100644 --- a/ports/dlib/portfile.cmake +++ b/ports/dlib/portfile.cmake @@ -51,6 +51,12 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/travis) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/cmake_utils) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/dlib/external/libpng/arm) +# Dlib encodes debug/release in its config.h. Patch it to respond to the NDEBUG macro instead. +file(READ ${CURRENT_PACKAGES_DIR}/include/dlib/config.h _contents) +string(REPLACE "/* #undef ENABLE_ASSERTS */" "#if !defined(NDEBUG)\n#define ENABLE_ASSERTS\n#endif" _contents ${_contents}) +string(REPLACE "#define DLIB_DISABLE_ASSERTS" "#if defined(NDEBUG)\n#define DLIB_DISABLE_ASSERTS\n#endif" _contents ${_contents}) +file(WRITE ${CURRENT_PACKAGES_DIR}/include/dlib/config.h ${_contents}) + # Handle copyright file(COPY ${CURRENT_PACKAGES_DIR}/share/doc/dlib/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/dlib) file(RENAME ${CURRENT_PACKAGES_DIR}/share/dlib/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/dlib/COPYRIGHT)