[llvm] 657ac8e - [CMake] Fix incorrect handling of get_target_property failure
Christopher Tetreault via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 29 14:46:07 PDT 2020
Author: Christopher Tetreault
Date: 2020-06-29T14:44:14-07:00
New Revision: 657ac8e717e3cbb121e424c0cb6e2cffdacfd533
URL: https://github.com/llvm/llvm-project/commit/657ac8e717e3cbb121e424c0cb6e2cffdacfd533
DIFF: https://github.com/llvm/llvm-project/commit/657ac8e717e3cbb121e424c0cb6e2cffdacfd533.diff
LOG: [CMake] Fix incorrect handling of get_target_property failure
Summary:
add_unittest was checking that the result of get_target_property was not
"NOTFOUND", but despite what the documentation says, get_target_property
returns <the var>-NOTFOUND on failure.
Reviewers: efriedma, thakis, serge-sans-paille, chandlerc
Reviewed By: serge-sans-paille
Subscribers: mgorny, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D81762
Added:
Modified:
llvm/cmake/modules/AddLLVM.cmake
Removed:
################################################################################
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index e25c72f3cae3..b524b488ecf3 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -1428,7 +1428,7 @@ function(add_unittest test_suite test_name)
add_dependencies(${test_suite} ${test_name})
get_target_property(test_suite_folder ${test_suite} FOLDER)
- if (NOT ${test_suite_folder} STREQUAL "NOTFOUND")
+ if (test_suite_folder)
set_property(TARGET ${test_name} PROPERTY FOLDER "${test_suite_folder}")
endif ()
endfunction()
More information about the llvm-commits
mailing list