diff options
author | Brad King <brad.king@kitware.com> | 2019-02-04 13:58:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-02-04 14:02:47 (GMT) |
commit | 36cf44a7a3a8931c97790db6df61439d4dd86ea3 (patch) | |
tree | 7e7dba2cdb3e56c9e1d6188e84467b0b4dfb9ba3 /Tests/RunCMake | |
parent | d21769d5ddad9a76c3f2c773b8be6961ad159af3 (diff) | |
download | CMake-36cf44a7a3a8931c97790db6df61439d4dd86ea3.zip CMake-36cf44a7a3a8931c97790db6df61439d4dd86ea3.tar.gz CMake-36cf44a7a3a8931c97790db6df61439d4dd86ea3.tar.bz2 |
Tests: Isolate RunCMake.XcodeProject per-device cases from host arch
Run all host cases before per-device cases. Do not expose the host
`CMAKE_OSX_ARCHITECTURES` environment value to the per-device tests.
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/XcodeProject/RunCMakeTest.cmake | 65 |
1 files changed, 35 insertions, 30 deletions
diff --git a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake index fb04005..6ea0c0c 100644 --- a/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake +++ b/Tests/RunCMake/XcodeProject/RunCMakeTest.cmake @@ -25,6 +25,40 @@ run_cmake(PerConfigPerSourceOptions) run_cmake(PerConfigPerSourceDefinitions) run_cmake(PerConfigPerSourceIncludeDirs) +function(XcodeSchemaGeneration) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeSchemaGeneration-build) + set(RunCMake_TEST_NO_CLEAN 1) + set(RunCMake_TEST_OPTIONS "-DCMAKE_XCODE_GENERATE_SCHEME=ON") + + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + + run_cmake(XcodeSchemaGeneration) + run_cmake_command(XcodeSchemaGeneration-build xcodebuild -scheme foo build) +endfunction() + +if(NOT XCODE_VERSION VERSION_LESS 7) + XcodeSchemaGeneration() + run_cmake(XcodeSchemaProperty) +endif() + +function(XcodeDependOnZeroCheck) + set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeDependOnZeroCheck-build) + set(RunCMake_TEST_NO_CLEAN 1) + + file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + + run_cmake(XcodeDependOnZeroCheck) + run_cmake_command(XcodeDependOnZeroCheck-build ${CMAKE_COMMAND} --build . --target parentdirlib) + run_cmake_command(XcodeDependOnZeroCheck-build ${CMAKE_COMMAND} --build . --target subdirlib) +endfunction() + +XcodeDependOnZeroCheck() + +# Isolate device tests from host architecture selection. +unset(ENV{CMAKE_OSX_ARCHITECTURES}) + # Use a single build tree for a few tests without cleaning. if(NOT XCODE_VERSION VERSION_LESS 5) @@ -205,23 +239,6 @@ if(NOT XCODE_VERSION VERSION_LESS 5) unset(RunCMake_TEST_OPTIONS) endif() -function(XcodeSchemaGeneration) - set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeSchemaGeneration-build) - set(RunCMake_TEST_NO_CLEAN 1) - set(RunCMake_TEST_OPTIONS "-DCMAKE_XCODE_GENERATE_SCHEME=ON") - - file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") - file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") - - run_cmake(XcodeSchemaGeneration) - run_cmake_command(XcodeSchemaGeneration-build xcodebuild -scheme foo build) -endfunction() - -if(NOT XCODE_VERSION VERSION_LESS 7) - XcodeSchemaGeneration() - run_cmake(XcodeSchemaProperty) -endif() - if(XCODE_VERSION VERSION_GREATER_EQUAL 8) function(deploymeny_target_test SDK) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/DeploymentTarget-${SDK}-build) @@ -240,16 +257,4 @@ if(XCODE_VERSION VERSION_GREATER_EQUAL 8) endforeach() endif() -function(XcodeDependOnZeroCheck) - set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/XcodeDependOnZeroCheck-build) - set(RunCMake_TEST_NO_CLEAN 1) - - file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") - file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") - - run_cmake(XcodeDependOnZeroCheck) - run_cmake_command(XcodeDependOnZeroCheck-build ${CMAKE_COMMAND} --build . --target parentdirlib) - run_cmake_command(XcodeDependOnZeroCheck-build ${CMAKE_COMMAND} --build . --target subdirlib) -endfunction() - -XcodeDependOnZeroCheck() +# Please add macOS-only tests above before the device-specific tests. |