Skip to content

Commit

Permalink
Fix cross-compile build (#224)
Browse files Browse the repository at this point in the history
During cross-compiling it's common to set CMAKE_FIND_ROOT_PATH to the
directory containing target environment and restrict CMake from
searching outside of it. In case of searching in llvm folder we should
set NO_CMAKE_FIND_ROOT_PATH option to override such behavior.

Co-authored-by: Semenov, Vadim <vadim.semenov@intel.com>
  • Loading branch information
sys-cmllvm and vsemenov368 authored Sep 3, 2024
1 parent e1e2f81 commit 98ff865
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions GenXIntrinsics/include/llvm/GenXIntrinsics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#=========================== begin_copyright_notice ============================
#
# Copyright (C) 2019-2021 Intel Corporation
# Copyright (C) 2019-2024 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
Expand Down Expand Up @@ -29,7 +29,7 @@ else()
endif()

if(${LLVM_VERSION_MAJOR} LESS 9)
find_file(FOUND_VCS GetSVN.cmake PATHS ${LLVM_CMAKE_DIR} REQUIRED)
find_file(FOUND_VCS GetSVN.cmake PATHS ${LLVM_CMAKE_DIR} REQUIRED NO_CMAKE_FIND_ROOT_PATH)
add_custom_command(
OUTPUT "${version_inc}"
COMMAND
Expand All @@ -38,7 +38,7 @@ if(${LLVM_VERSION_MAJOR} LESS 9)
"-DHEADER_FILE=${version_inc}"
-P "${FOUND_VCS}")
else()
find_file(FOUND_VCS VersionFromVCS.cmake PATHS ${LLVM_CMAKE_DIR} REQUIRED)
find_file(FOUND_VCS VersionFromVCS.cmake PATHS ${LLVM_CMAKE_DIR} REQUIRED NO_CMAKE_FIND_ROOT_PATH)
add_custom_command(
OUTPUT "${version_inc}"
COMMAND
Expand All @@ -59,3 +59,4 @@ add_custom_target(GenXIntrinsicDescriptionGen
)
add_custom_target(GenXIntrinsicsGen)
add_dependencies(GenXIntrinsicsGen GenXIntrinsicDescriptionGen)

0 comments on commit 98ff865

Please sign in to comment.