aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/dlib/CONTROL2
-rw-r--r--ports/dlib/portfile.cmake6
2 files changed, 7 insertions, 1 deletions
diff --git a/ports/dlib/CONTROL b/ports/dlib/CONTROL
index 952e267ae..a6e886c4a 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 47fbb7ea7..2a5ae6f44 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)