[test-suite] r267461 - [test-suite] There is no need to check for name clashes explicitly.
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 25 13:28:56 PDT 2016
Author: tra
Date: Mon Apr 25 15:28:56 2016
New Revision: 267461
URL: http://llvm.org/viewvc/llvm-project?rev=267461&view=rev
Log:
[test-suite] There is no need to check for name clashes explicitly.
cmake_minimum_required(VERSION 3.2) sets CMP0002 policy to NEW
which will produce an error when someone attempts to create a
new target with the same name.
When that happens llvm_target_prefix() can be used to ensure unique
names for targets within.
Modified:
test-suite/trunk/cmake/modules/SingleMultiSource.cmake
Modified: test-suite/trunk/cmake/modules/SingleMultiSource.cmake
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/cmake/modules/SingleMultiSource.cmake?rev=267461&r1=267460&r2=267461&view=diff
==============================================================================
--- test-suite/trunk/cmake/modules/SingleMultiSource.cmake (original)
+++ test-suite/trunk/cmake/modules/SingleMultiSource.cmake Mon Apr 25 15:28:56 2016
@@ -26,24 +26,11 @@ endfunction()
# Given a source file name after which a test should be named, create a unique
# name for the test. Usually this is just the source file with the suffix
# stripped, and ${TARGET_PREFIX} prepended.
-set_property(GLOBAL PROPERTY registered_executables)
function(get_unique_exe_name new_name main_src)
- get_property(registered_executables GLOBAL PROPERTY registered_executables)
-
string(REGEX REPLACE ".[cp]+$" "" path ${main_src})
get_filename_component(name ${path} NAME )
- set(name "${TARGET_PREFIX}${name}")
-
- list(FIND registered_executables ${name} name_idx)
-
- if(${name_idx} EQUAL -1)
- set(${new_name} ${name} PARENT_SCOPE)
- set_property(GLOBAL APPEND PROPERTY registered_executables ${name})
- return()
- endif()
- message(FATAL_ERROR "Duplicate executable name!"
- "Please set unique prefix with llvm_target_prefix().")
+ set(${new_name} "${TARGET_PREFIX}${name}" PARENT_SCOPE)
endfunction()
# Add flags to a cmake target property.
More information about the llvm-commits
mailing list