Merge pull request #190 from xixiha5230/patch-1

Use CMake string(TIMESTAMP) for portable compile timestamp
This commit is contained in:
Larvan2 2024-03-31 15:52:23 +08:00 committed by GitHub
commit 53bc1da503
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,11 +28,7 @@ string (REGEX REPLACE "[\n\t\r]" "" CURRENT_BRANCH ${CURRENT_BRANCH})
message(STATUS "git current branch = ${CURRENT_BRANCH}") message(STATUS "git current branch = ${CURRENT_BRANCH}")
# #
execute_process( string(TIMESTAMP COMPILE_TIME "%y%m%d")
COMMAND date +"%y%m%d"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE COMPILE_TIME
)
string (REGEX REPLACE "[\n\t\r]" "" COMPILE_TIME ${COMPILE_TIME}) string (REGEX REPLACE "[\n\t\r]" "" COMPILE_TIME ${COMPILE_TIME})
string(REGEX REPLACE "\"" "" COMPILE_TIME ${COMPILE_TIME}) string(REGEX REPLACE "\"" "" COMPILE_TIME ${COMPILE_TIME})
@ -70,4 +66,4 @@ include_directories("${GO_SOURCE}")
link_directories("${GO_OUTPUT_BASE}/${CMAKE_ANDROID_ARCH_ABI}") link_directories("${GO_OUTPUT_BASE}/${CMAKE_ANDROID_ARCH_ABI}")
add_library(bridge SHARED main.c jni_helper.c bridge_helper.c) add_library(bridge SHARED main.c jni_helper.c bridge_helper.c)
target_link_libraries(bridge log clash) target_link_libraries(bridge log clash)