Skip to content

Commit

Permalink
Add backtrace detection patch to glog
Browse files Browse the repository at this point in the history
  • Loading branch information
ViliusSutkus89 committed Jul 22, 2024
1 parent fcee04f commit d5d384a
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
5 changes: 4 additions & 1 deletion recipes/odrcore/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ patches:
- patch_file: "patches/1.0.0-0001-fix-cmake-install.patch"
patch_description: "Fix header install in CMakeLists.txt"
patch_type: "conan"
- patch_file: "patches/1.0.0-0002-fix-cryptopp-cpu-features.patch"
- patch_file: "patches/1.0.0-0002-fix-glog-stacktrace-misdetection.patch"
patch_description: "Glog checks if execinfo.h is available and if it is - expects backtrace to be there, but backtrace only available from Android API 33"
patch_type: "conan"
- patch_file: "patches/1.0.0-0003-fix-cryptopp-cpu-features.patch"
patch_description: "Cryptopp expects cpu-features.h and .c to be in the source dir, prepare them"
patch_type: "conan"
"2.0.0":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -59,6 +59,13 @@
FetchContent_GetProperties(glog)
if(NOT glog_POPULATED)
FetchContent_Populate(glog)
+ file(READ ${glog_SOURCE_DIR}/CMakeLists.txt GLOG_CMAKELISTS)
+ string(REPLACE
+ "set (HAVE_STACKTRACE 1)"
+ "if (NOT DEFINED ANDROID)\nset (HAVE_STACKTRACE 1)\nendif(NOT DEFINED ANDROID)"
+ GLOG_CMAKELISTS
+ "${GLOG_CMAKELISTS}")
+ file(WRITE ${glog_SOURCE_DIR}/CMakeLists.txt "${GLOG_CMAKELISTS}")
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
add_subdirectory(${glog_SOURCE_DIR} ${glog_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
--- CMakeLists.txt
+++ CMakeLists.txt 2024-07-22 14:56:00 +0300
@@ -82,6 +82,10 @@
+++ CMakeLists.txt
@@ -89,6 +89,10 @@
FetchContent_GetProperties(cryptopp)
if(NOT cryptopp_POPULATED)
FetchContent_Populate(cryptopp)
+ if (DEFINED CMAKE_ANDROID_NDK)
+ file(COPY ${CMAKE_ANDROID_NDK}/sources/android/cpufeatures/cpu-features.c DESTINATION ${cryptopp_SOURCE_DIR})
+ file(COPY ${CMAKE_ANDROID_NDK}/sources/android/cpufeatures/cpu-features.h DESTINATION ${cryptopp_SOURCE_DIR})
+ endif (DEFINED CMAKE_ANDROID_NDK)
+ endif(DEFINED CMAKE_ANDROID_NDK)
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
add_subdirectory(${cryptopp_SOURCE_DIR} ${cryptopp_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()

0 comments on commit d5d384a

Please sign in to comment.