Skip to content

Commit

Permalink
Make cmake export libxaie path to air if (i) libxaie is user defined,…
Browse files Browse the repository at this point in the history
… and (ii) built from vitis (#554)
  • Loading branch information
erwei-xilinx authored Jul 26, 2023
1 parent 07a9db4 commit 5c241b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
12 changes: 2 additions & 10 deletions cmake/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ set(AIE_CONFIG_INCLUDE_DIRS
set(AIE_CONFIG_EXPORTS_FILE "\${AIE_CMAKE_DIR}/AIETargets.cmake")
set(AIE_CONFIG_LibXAIE_x86_64_DIR)
if ("x86_64" IN_LIST AIE_RUNTIME_TARGETS)
set(AIE_CONFIG_LibXAIE_x86_64_DIR "${PROJECT_BINARY_DIR}/runtime_lib/x86_64/xaiengine")
set(AIE_CONFIG_LibXAIE_x86_64_DIR "${LibXAIE_x86_64_DIR}")
endif()
set(AIE_CONFIG_LibXAIE_aarch64_DIR)
if ("aarch64" IN_LIST AIE_RUNTIME_TARGETS)
set(AIE_CONFIG_LibXAIE_aarch64_DIR "${PROJECT_BINARY_DIR}/runtime_lib/aarch64/xaiengine")
set(AIE_CONFIG_LibXAIE_aarch64_DIR "${LibXAIE_aarch64_DIR}")
endif()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/AIEConfig.cmake.in
Expand Down Expand Up @@ -62,14 +62,6 @@ set(AIE_CONFIG_INCLUDE_DIRS
"\${AIE_INSTALL_PREFIX}/include"
)
set(AIE_CONFIG_EXPORTS_FILE "\${AIE_CMAKE_DIR}/AIETargets.cmake")
set(AIE_CONFIG_LibXAIE_x86_64_DIR)
if ("x86_64" IN_LIST AIE_RUNTIME_TARGETS)
set(AIE_CONFIG_LibXAIE_x86_64_DIR "\${AIE_INSTALL_PREFIX}/runtime_lib/x86_64/xaiengine")
endif()
set(AIE_CONFIG_LibXAIE_aarch64_DIR)
if ("aarch64" IN_LIST AIE_RUNTIME_TARGETS)
set(AIE_CONFIG_LibXAIE_aarch64_DIR "\${AIE_INSTALL_PREFIX}/runtime_lib/aarch64/xaiengine")
endif()

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/AIEConfig.cmake.in
Expand Down
5 changes: 5 additions & 0 deletions runtime_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,9 @@ foreach(target ${AIE_RUNTIME_TARGETS})
TEST_EXCLUDE_FROM_MAIN true
)
endif()

# Export newly built libxaie
if (NOT DEFINED LibXAIE_${target}_DIR)
set(LibXAIE_${target}_DIR ${CMAKE_CURRENT_BINARY_DIR}/${target}/xaiengine PARENT_SCOPE)
endif()
endforeach()

0 comments on commit 5c241b3

Please sign in to comment.