mirror of
https://github.com/Kitware/CMake.git
synced 2026-08-07 16:20:51 +00:00
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.
This commit is contained in:
@@ -59,6 +59,10 @@ add_executable(bar bar.cxx
|
|||||||
${CMAKE_CURRENT_BINARY_DIR}/noregen.h
|
${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")
|
if("${CMAKE_GENERATOR}" MATCHES "Make")
|
||||||
# Test the IMPLICIT_DEPENDS feature.
|
# Test the IMPLICIT_DEPENDS feature.
|
||||||
|
|||||||
@@ -7,8 +7,14 @@ int main(int argc, char** argv)
|
|||||||
{
|
{
|
||||||
/* Make sure the noregen header was not regenerated. */
|
/* Make sure the noregen header was not regenerated. */
|
||||||
if (strcmp("foo", noregen_string) != 0) {
|
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");
|
printf("FAILED: noregen.h was regenerated!\n");
|
||||||
return 1;
|
return 1;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print out the string that should have been regenerated. */
|
/* Print out the string that should have been regenerated. */
|
||||||
|
|||||||
Reference in New Issue
Block a user