diff --git a/mlir/lib/ExecutionEngine/CMakeLists.txt b/mlir/lib/ExecutionEngine/CMakeLists.txt --- a/mlir/lib/ExecutionEngine/CMakeLists.txt +++ b/mlir/lib/ExecutionEngine/CMakeLists.txt @@ -119,6 +119,10 @@ MLIRSupport ) +if(NOT LLVM_ENABLE_PIC) + return() +endif() + add_mlir_library(mlir_float16_utils SHARED Float16bits.cpp diff --git a/mlir/test/CMakeLists.txt b/mlir/test/CMakeLists.txt --- a/mlir/test/CMakeLists.txt +++ b/mlir/test/CMakeLists.txt @@ -89,7 +89,7 @@ # The native target may not be enabled, in this case we won't # run tests that involves executing on the host: do not build # useless binaries. -if(TARGET ${LLVM_NATIVE_ARCH}) +if(LLVM_ENABLE_PIC AND TARGET ${LLVM_NATIVE_ARCH}) list(APPEND MLIR_TEST_DEPENDS mlir-cpu-runner llc