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

Export libxaie directory to air #549

Merged
merged 2 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions cmake/modules/AIEConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# (c) Copyright 2021 Xilinx Inc.
# (c) Copyright 2023 Advanced Micro Devices Inc.

# This file allows users to call find_package(AIE) and pick up our targets.

Expand All @@ -14,9 +15,13 @@ set(AIE_CMAKE_DIR "@AIE_CONFIG_CMAKE_DIR@")
set(AIE_BINARY_DIR "@AIE_CONFIG_BINARY_DIR@")
set(AIE_TOOLS_BINARY_DIR "@AIE_CONFIG_TOOLS_BINARY_DIR@")
set(AIE_INCLUDE_DIRS "@AIE_CONFIG_INCLUDE_DIRS@")

# Provide AIE configurations for users to inherit from.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments are always appreciated. :-)

set(AIE_RUNTIME_TARGETS "@AIE_RUNTIME_TARGETS@")
set(AIE_COMPILER "@AIE_COMPILER@")
set(AIE_LINKER "@AIE_LINKER@")
set(LibXAIE_x86_64_DIR "@AIE_CONFIG_LibXAIE_x86_64_DIR@")
set(LibXAIE_aarch64_DIR "@AIE_CONFIG_LibXAIE_aarch64_DIR@")

# Provide all our library targets to users.
include("@AIE_CONFIG_EXPORTS_FILE@")
Expand Down
21 changes: 21 additions & 0 deletions cmake/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# (c) Copyright 2021 Xilinx Inc.
# (c) Copyright 2023 Advanced Micro Devices Inc.

# Generate a list of CMake library targets so that other CMake projects can
# link against them. LLVM calls its version of this file LLVMExports.cmake, but
Expand All @@ -24,6 +25,14 @@ set(AIE_CONFIG_INCLUDE_DIRS
"${PROJECT_BINARY_DIR}/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 "${PROJECT_BINARY_DIR}/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 "${PROJECT_BINARY_DIR}/runtime_lib/aarch64/xaiengine")
endif()
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/AIEConfig.cmake.in
${aie_cmake_builddir}/AIEConfig.cmake
Expand Down Expand Up @@ -53,6 +62,15 @@ 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
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/AIEConfig.cmake
Expand All @@ -63,6 +81,9 @@ set(AIE_CONFIG_BINARY_DIR)
set(AIE_CONFIG_TOOLS_BINARY_DIR)
set(AIE_CONFIG_INCLUDE_DIRS)
set(AIE_CONFIG_EXPORTS_FILE)
set(AIE_CONFIG_LibXAIE_x86_64_DIR)
set(AIE_CONFIG_LibXAIE_aarch64_DIR)


# export targets for the install directory
install(EXPORT AIETargets DESTINATION ${AIE_INSTALL_PACKAGE_DIR}
Expand Down
Loading