summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-15 17:57:26 (GMT)
committerBrad King <brad.king@kitware.com>2020-09-18 17:02:19 (GMT)
commit832a78be2d11568d80156dabfad4e21d5a05650d (patch)
treeddae4ab655cbf146d5ba1373ec4418fd633bb4be /Tests
parentff76c51ec32fb690d3e7d2889f13f03dc8b78b87 (diff)
downloadCMake-832a78be2d11568d80156dabfad4e21d5a05650d.zip
CMake-832a78be2d11568d80156dabfad4e21d5a05650d.tar.gz
CMake-832a78be2d11568d80156dabfad4e21d5a05650d.tar.bz2
Tests: Update BuildDepends test for Xcode "new build system"
Xcode somehow tracks what we're running inside a custom command, so we cannot prevent it from regenerating the `noregen.h` header even though we do not declare any dependencies of it.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/BuildDepends/Project/CMakeLists.txt4
-rw-r--r--Tests/BuildDepends/Project/bar.cxx6
2 files changed, 10 insertions, 0 deletions
diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt
index 83583c9..c438e1d 100644
--- a/Tests/BuildDepends/Project/CMakeLists.txt
+++ b/Tests/BuildDepends/Project/CMakeLists.txt
@@ -59,6 +59,10 @@ add_executable(bar bar.cxx
${CMAKE_CURRENT_BINARY_DIR}/noregen.h
)
+if(CMAKE_XCODE_BUILD_SYSTEM VERSION_GREATER_EQUAL 12)
+ target_compile_definitions(bar PRIVATE XCODE_NEW_BUILD_SYSTEM)
+endif()
+
#-----------------------------------------------------------------------------
if("${CMAKE_GENERATOR}" MATCHES "Make")
# Test the IMPLICIT_DEPENDS feature.
diff --git a/Tests/BuildDepends/Project/bar.cxx b/Tests/BuildDepends/Project/bar.cxx
index ec7aa65..825d661 100644
--- a/Tests/BuildDepends/Project/bar.cxx
+++ b/Tests/BuildDepends/Project/bar.cxx
@@ -7,8 +7,14 @@ int main(int argc, char** argv)
{
/* Make sure the noregen header was not regenerated. */
if (strcmp("foo", noregen_string) != 0) {
+#ifdef XCODE_NEW_BUILD_SYSTEM
+ fprintf(stderr,
+ "Known limitation: noregen.h was regenerated "
+ "but we cannot stop Xcode from doing this!\n");
+#else
printf("FAILED: noregen.h was regenerated!\n");
return 1;
+#endif
}
/* Print out the string that should have been regenerated. */