Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[aot] Remove redundant copy of libtaichi_c_api.so to build #8014

Merged
merged 1 commit into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/scripts/aot-demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ function prepare-unity-build-env {

python3 misc/generate_unity_language_binding.py
cp c_api/unity/*.cs Taichi-UnityExample/Assets/Taichi/Generated
cp build/libtaichi_c_api.so Taichi-UnityExample/Assets/Plugins/Android
CAPI_SO_LOC=$(find . -wholename "**/cmake-build/libtaichi_c_api.so")
cp $CAPI_SO_LOC Taichi-UnityExample/Assets/Plugins/Android

export TAICHI_REPO_DIR=$(pwd)

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/scripts/ti_build/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ def build_android(python: Command, pip: Command) -> None:
pip.install("-r", "requirements_dev.txt")
python("setup.py", "clean")
python("setup.py", "build_ext")
sh("aarch64-linux-android-strip", "build/libtaichi_c_api.so")
for p in Path(os.getcwd()).glob("**/libtaichi_c_api.so"):
sh("aarch64-linux-android-strip", p)
21 changes: 0 additions & 21 deletions cmake/TaichiCAPI.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,27 +90,6 @@ elseif(APPLE)
target_link_options(${TAICHI_C_API_NAME} PRIVATE -Wl,-exported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/c_api/version_scripts/export_symbols_mac.lds)
endif()

set(C_API_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/build")
set_target_properties(${TAICHI_C_API_NAME} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${C_API_OUTPUT_DIRECTORY}
ARCHIVE_OUTPUT_DIRECTORY ${C_API_OUTPUT_DIRECTORY})

if (${CMAKE_GENERATOR} MATCHES "^Visual Studio")
# Visual Studio is a multi-config generator, which appends ${CMAKE_BUILD_TYPE} to the output folder
add_custom_command(
TARGET ${TAICHI_C_API_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${C_API_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${TAICHI_C_API_NAME}.dll
${C_API_OUTPUT_DIRECTORY}/${TAICHI_C_API_NAME}.dll)
elseif (${CMAKE_GENERATOR} STREQUAL "XCode")
# XCode is also a multi-config generator
add_custom_command(
TARGET ${TAICHI_C_API_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${C_API_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/lib${TAICHI_C_API_NAME}.dylib
${C_API_OUTPUT_DIRECTORY}/lib${TAICHI_C_API_NAME}.dylib)
endif()

target_include_directories(${TAICHI_C_API_NAME}
PUBLIC
# Used when building the library:
Expand Down