Guard test customization only if target exists. This was failing when built with IREE_BUILD_TESTS=OFF (as is done for releases).
diff --git a/compiler/src/iree/compiler/API2/test/CMakeLists.txt b/compiler/src/iree/compiler/API2/test/CMakeLists.txt index 74a35cb..dd9f75c 100644 --- a/compiler/src/iree/compiler/API2/test/CMakeLists.txt +++ b/compiler/src/iree/compiler/API2/test/CMakeLists.txt
@@ -25,8 +25,10 @@ # Move to bin/ directory and systematically name more appropriately. # See: https://github.com/iree-org/iree/issues/11297 -set_target_properties(iree_compiler_API2_test_api-test-binary - PROPERTIES - OUTPUT_NAME "test-iree-compiler-api-test-binary" - RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tools" -) +if(TARGET iree_compiler_API2_test_api-test-binary) + set_target_properties(iree_compiler_API2_test_api-test-binary + PROPERTIES + OUTPUT_NAME "test-iree-compiler-api-test-binary" + RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/tools" + ) +endif()