소스 검색

Tests: Fix RunCMake.CompileFeatures test NonValidTarget2 case

Mark the generated source file with the GENERATED property explicitly
since it is not marked automatically as the output of any custom
command.  Mark both the 0 and 1 variants so it works no matter the
outcome of the generator expression.
Brad King 11 년 전
부모
커밋
b341799e53
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      Tests/RunCMake/CompileFeatures/NonValidTarget2.cmake

+ 2 - 0
Tests/RunCMake/CompileFeatures/NonValidTarget2.cmake

@@ -4,5 +4,7 @@ set(genexvar $<COMPILE_FEATURES:cxx_final>)
 add_custom_target(copy_target
   COMMAND "${CMAKE_COMMAND}" -E copy "${CMAKE_CURRENT_SOURCE_DIR}/empty.cpp" "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.txt"
 )
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/copied_file0.cpp" PROPERTY GENERATED 1)
+set_property(SOURCE "${CMAKE_CURRENT_BINARY_DIR}/copied_file1.cpp" PROPERTY GENERATED 1)
 
 add_library(empty "${CMAKE_CURRENT_BINARY_DIR}/copied_file${genexvar}.cpp")