Merge branch 'dev' into patch
This commit is contained in:
@ -90,6 +90,7 @@ else()
|
||||
endif()
|
||||
elseif(ANDROID_ABI)
|
||||
string(FIND "${ANDROID_ABI}" "arm64" UC_RET)
|
||||
file(WRITE ${CMAKE_BINARY_DIR}/adb.sh "#!/bin/bash\n\n# Auto-generated by CMakeLists.txt\n\nadb shell mkdir -p /data/local/tmp/build\n")
|
||||
|
||||
if (${UC_RET} GREATER_EQUAL "0")
|
||||
set(UNICORN_TARGET_ARCH "aarch64")
|
||||
@ -1031,6 +1032,9 @@ if (UNICORN_BUILD_SHARED)
|
||||
add_library(unicorn SHARED
|
||||
${UNICORN_SRCS}
|
||||
)
|
||||
if (ANDROID_ABI)
|
||||
file(APPEND ${CMAKE_BINARY_DIR}/adb.sh "adb push ./libunicorn.so /data/local/tmp/build/\n")
|
||||
endif()
|
||||
else()
|
||||
add_library(unicorn STATIC
|
||||
${UNICORN_SRCS}
|
||||
@ -1167,22 +1171,27 @@ if(UNICORN_FUZZ)
|
||||
endforeach()
|
||||
else()
|
||||
foreach(SAMPLE_FILE ${UNICORN_SAMPLE_FILE})
|
||||
add_executable(${SAMPLE_FILE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/samples/${SAMPLE_FILE}.c
|
||||
)
|
||||
target_link_libraries(${SAMPLE_FILE}
|
||||
${SAMPLES_LIB}
|
||||
)
|
||||
endforeach(SAMPLE_FILE)
|
||||
add_executable(${SAMPLE_FILE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/samples/${SAMPLE_FILE}.c
|
||||
)
|
||||
target_link_libraries(${SAMPLE_FILE}
|
||||
${SAMPLES_LIB}
|
||||
)
|
||||
endforeach(SAMPLE_FILE)
|
||||
|
||||
foreach(TEST_FILE ${UNICORN_TEST_FILE})
|
||||
add_executable(${TEST_FILE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tests/unit/${TEST_FILE}.c
|
||||
)
|
||||
target_link_libraries(${TEST_FILE}
|
||||
${SAMPLES_LIB}
|
||||
)
|
||||
add_test(${TEST_FILE} ${TEST_FILE})
|
||||
foreach(TEST_FILE ${UNICORN_TEST_FILE})
|
||||
add_executable(${TEST_FILE}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tests/unit/${TEST_FILE}.c
|
||||
)
|
||||
target_link_libraries(${TEST_FILE}
|
||||
${SAMPLES_LIB}
|
||||
)
|
||||
add_test(${TEST_FILE} ${TEST_FILE})
|
||||
if (ANDROID_ABI)
|
||||
file(APPEND ${CMAKE_BINARY_DIR}/adb.sh "adb push ${TEST_FILE} /data/local/tmp/build/\n")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}/adb.sh "adb shell \"chmod +x /data/local/tmp/build/${TEST_FILE}\"\n")
|
||||
file(APPEND ${CMAKE_BINARY_DIR}/adb.sh "adb shell \'LD_LIBRARY_PATH=/data/local/tmp/build:$LD_LIBRARY_PATH /data/local/tmp/build/${TEST_FILE}\' || exit -1\n")
|
||||
endif()
|
||||
endforeach(TEST_FILE)
|
||||
endif()
|
||||
|
||||
|
Reference in New Issue
Block a user