diff options
author | Brad King <brad.king@kitware.com> | 2020-06-09 13:23:25 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-06-09 13:23:50 (GMT) |
commit | 293d89ce0981bdb09065bc412330b672a1fdf598 (patch) | |
tree | a59c269fe4518fa2a408e7730191e10a8d9098b5 /Tests | |
parent | 7c8c28b5caed93a6ba56675d35e81f1f0b56c83f (diff) | |
parent | d3d98288e27b344560b59c46e54c3dd9e700de40 (diff) | |
download | CMake-293d89ce0981bdb09065bc412330b672a1fdf598.zip CMake-293d89ce0981bdb09065bc412330b672a1fdf598.tar.gz CMake-293d89ce0981bdb09065bc412330b672a1fdf598.tar.bz2 |
Merge topic 'android-windows-multi-config'
d3d98288e2 Tests: Ensure that Android tests work for multi-config generators
be9633bc6e Tests: Append .exe suffix to objdump in Android test on Windows
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4858
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/Android/RunCMakeTest.cmake | 31 | ||||
-rw-r--r-- | Tests/RunCMake/Android/common.cmake | 2 |
2 files changed, 28 insertions, 5 deletions
diff --git a/Tests/RunCMake/Android/RunCMakeTest.cmake b/Tests/RunCMake/Android/RunCMakeTest.cmake index 45798ce..234525a 100644 --- a/Tests/RunCMake/Android/RunCMakeTest.cmake +++ b/Tests/RunCMake/Android/RunCMakeTest.cmake @@ -18,7 +18,19 @@ function(run_Android case) file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}") file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") run_cmake(${case}) - run_cmake_command(${case}-build ${CMAKE_COMMAND} --build .) + set(configs ".") + if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(configs Release Debug) + endif() + foreach(config IN LISTS configs) + set(build_suffix) + set(config_arg) + if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(build_suffix "-${config}") + set(config_arg --config "${config}") + endif() + run_cmake_command(${case}-build${build_suffix} ${CMAKE_COMMAND} --build . ${config_arg}) + endforeach() endfunction() set(RunCMake_TEST_OPTIONS @@ -166,14 +178,25 @@ foreach(ndk IN LISTS TEST_ANDROID_NDK) # Test all combinations. foreach(vers IN LISTS _versions) foreach(stl IN LISTS stl_types) - foreach(config Release Debug) + set(configs Release Debug) + set(foreach_list "${configs}") + if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(foreach_list ".") + endif() + foreach(config IN LISTS foreach_list) # Test this combination for all available abis. - message(STATUS "ndk='${ndk}' vers='${vers}' stl='${stl}' config='${config}'") + set(config_status " config='${config}'") + set(build_type_arg "-DCMAKE_BUILD_TYPE=${config}") + if(RunCMake_GENERATOR_IS_MULTI_CONFIG) + set(config_status) + string(REPLACE ";" "\\\\;" build_type_arg "-DCMAKE_CONFIGURATION_TYPES=${configs}") + endif() + message(STATUS "ndk='${ndk}' vers='${vers}' stl='${stl}'${config_status}") set(RunCMake_TEST_OPTIONS -DCMAKE_ANDROID_NDK=${ndk} -DCMAKE_ANDROID_NDK_TOOLCHAIN_VERSION=${vers} -DCMAKE_ANDROID_STL_TYPE=${stl} - -DCMAKE_BUILD_TYPE=${config} + "${build_type_arg}" ) foreach(abi IN LISTS abi_names) # Skip ABIs not supported by this compiler. diff --git a/Tests/RunCMake/Android/common.cmake b/Tests/RunCMake/Android/common.cmake index d96ab86..32412aa 100644 --- a/Tests/RunCMake/Android/common.cmake +++ b/Tests/RunCMake/Android/common.cmake @@ -96,7 +96,7 @@ add_executable(android_c android.c) add_executable(android_cxx android.cxx) add_library(android_cxx_lib SHARED android_lib.cxx) -set(objdump "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}objdump") +set(objdump "${CMAKE_CXX_ANDROID_TOOLCHAIN_PREFIX}objdump${CMAKE_CXX_ANDROID_TOOLCHAIN_SUFFIX}") if(NOT EXISTS "${objdump}") message(FATAL_ERROR "Expected tool missing:\n ${objdump}") endif() |