diff options
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2023-06-05 23:12:11 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2023-06-05 23:12:11 +0000 |
commit | 37fd5d2597e7665cb926e73e5ae2cf97021b4cf7 (patch) | |
tree | 2e545e150781b054c2d47bb044caf58ea4f216e1 | |
parent | ebf45c203e16d632cef55dbe53f97543aa367e68 (diff) | |
parent | 271dcb06116bec81af87b2b4cbc81e80406860f6 (diff) | |
download | ndk-37fd5d2597e7665cb926e73e5ae2cf97021b4cf7.tar.gz |
Merge "Improve accuracy of the cmake exports test."
-rw-r--r-- | tests/build/cmake_exports/CMakeLists.txt | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/tests/build/cmake_exports/CMakeLists.txt b/tests/build/cmake_exports/CMakeLists.txt index 8ac37df09..f23a5e588 100644 --- a/tests/build/cmake_exports/CMakeLists.txt +++ b/tests/build/cmake_exports/CMakeLists.txt @@ -1,22 +1,12 @@ cmake_minimum_required(VERSION 3.22) project(CMakeExportsTest C CXX) -if(NOT DEFINED CMAKE_C_COMPILER) - message(FATAL_ERROR "CMAKE_C_COMPILER not set") -endif() - -if(NOT DEFINED CMAKE_CXX_COMPILER) - message(FATAL_ERROR "CMAKE_CXX_COMPILER not set") -endif() - -if(NOT DEFINED CMAKE_AR) - message(FATAL_ERROR "CMAKE_AR not set") -endif() - -if(NOT DEFINED CMAKE_STRIP) - message(FATAL_ERROR "CMAKE_STRIP not set") -endif() - -if(NOT DEFINED CMAKE_RANLIB) - message(FATAL_ERROR "CMAKE_RANLIB not set") -endif()
\ No newline at end of file +foreach(TEST_VAR CMAKE_C_COMPILER CMAKE_CXX_COMPILER CMAKE_AR CMAKE_STRIP CMAKE_RANLIB) + if(NOT DEFINED "${TEST_VAR}") + message(FATAL_ERROR "${TEST_VAR} not set") + elseif(NOT ${TEST_VAR} MATCHES "${CMAKE_ANDROID_NDK}") + message(FATAL_ERROR "${TEST_VAR} (${${TEST_VAR}}) is outside the NDK (${CMAKE_ANDROID_NDK})") + else() + message(WARNING "${TEST_VAR} is ${${TEST_VAR}}") + endif() +endforeach() |