File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 11[submodule "tunnel/tools/wireguard-tools "]
22 path = tunnel/tools/wireguard-tools
33 url = https://git.zx2c4.com/wireguard-tools
4+ [submodule "tunnel/tools/elf-cleaner "]
5+ path = tunnel/tools/elf-cleaner
6+ url = https://github.com/termux/termux-elf-cleaner
Original file line number Diff line number Diff line change @@ -28,3 +28,16 @@ add_custom_target(libwg-go.so WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/lib
2828 DESTDIR=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
2929 BUILDDIR=${CMAKE_LIBRARY_OUTPUT_DIRECTORY} /../generated -src
3030)
31+
32+ # Strip unwanted ELF sections to prevent DT_FLAGS_1 warnings on old Android versions
33+ file (GLOB ELF_CLEANER_SOURCES elf-cleaner/*.c elf-cleaner/*.cpp)
34+ add_custom_target (elf-cleaner COMMENT "Building elf-cleaner" VERBATIM COMMAND "${CMAKE_C_COMPILER} "
35+ -O2 -DPACKAGE_NAME="elf-cleaner" -DPACKAGE_VERSION="" -DCOPYRIGHT=""
36+ -o "${CMAKE_CURRENT_BINARY_DIR} /elf-cleaner" ${ELF_CLEANER_SOURCES}
37+ )
38+ add_custom_command (TARGET libwg.so POST_BUILD VERBATIM COMMAND "${CMAKE_CURRENT_BINARY_DIR} /elf-cleaner"
39+ --api-level "${ANDROID_NATIVE_API_LEVEL} " "$<TARGET_FILE:libwg.so>" )
40+ add_dependencies (libwg.so elf-cleaner)
41+ add_custom_command (TARGET libwg-quick.so POST_BUILD VERBATIM COMMAND "${CMAKE_CURRENT_BINARY_DIR} /elf-cleaner"
42+ --api-level "${ANDROID_NATIVE_API_LEVEL} " "$<TARGET_FILE:libwg-quick.so>" )
43+ add_dependencies (libwg-quick.so elf-cleaner)
You can’t perform that action at this time.
0 commit comments