From 1806cdd17c17fc202b4d7c195b1830cfc038a3a2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 15 Sep 2020 11:21:39 -0400 Subject: Tests: Avoid duplicate custom commands for Xcode "new build system" --- Tests/CustomCommand/CMakeLists.txt | 8 ++++++++ Tests/Module/ExternalData/Data5/CMakeLists.txt | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index 53d56bf..c1a7a57 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -514,6 +514,14 @@ add_custom_target(UseConsoleTarget ALL USES_TERMINAL ) +if(CMAKE_XCODE_BUILD_SYSTEM VERSION_GREATER_EQUAL 12) + # Xcode's "new build system" does not support multiple targets + # producing the same custom command output. + add_custom_target(GenPath DEPENDS "${gen_path}") + add_dependencies(NormDepends GenPath) + add_dependencies(UseConsole GenPath) +endif() + # Test COMMAND_EXPAND_LISTS set(cmp_args "1ARG=COMMAND_EXPAND_LISTS" "2ARG=test" "3ARG=outfile" "4ARG=content") diff --git a/Tests/Module/ExternalData/Data5/CMakeLists.txt b/Tests/Module/ExternalData/Data5/CMakeLists.txt index ea67f05..b13240d 100644 --- a/Tests/Module/ExternalData/Data5/CMakeLists.txt +++ b/Tests/Module/ExternalData/Data5/CMakeLists.txt @@ -6,6 +6,13 @@ ExternalData_Add_Test(Data5.A -P ${CMAKE_CURRENT_SOURCE_DIR}/Data5Check.cmake ) ExternalData_Add_Target(Data5.A) + +if(CMAKE_XCODE_BUILD_SYSTEM VERSION_GREATER_EQUAL 12) + # Xcode's "new build system" does not support multiple targets + # producing the same custom command output. + return() +endif() + ExternalData_Add_Test(Data5.B NAME Data5Check.B COMMAND ${CMAKE_COMMAND} -- cgit v0.12