diff options
author | Brad King <brad.king@kitware.com> | 2020-11-25 12:52:53 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-11-25 14:11:21 (GMT) |
commit | f3d4254b3d2437938440257cd989cb87da517e01 (patch) | |
tree | 8e71b84d4ad76e9ec895dd37f8f57f9fb5e08cc5 /Tests/RunCMake | |
parent | 01d91ae5f26c25fe11e4eedd16ed8d8163636015 (diff) | |
download | CMake-f3d4254b3d2437938440257cd989cb87da517e01.zip CMake-f3d4254b3d2437938440257cd989cb87da517e01.tar.gz CMake-f3d4254b3d2437938440257cd989cb87da517e01.tar.bz2 |
Check*: Tolerate variables set with names of languages
Fix the language checks added by commit 90dead024c (CheckCompilerFlag:
unified way to check compiler flags per language, 2020-09-25,
v3.19.0-rc1~88^2), commit 10ae907de0 (CheckSoureCompiles: Add a unified
way to check if a source compiles, 2020-09-14, v3.19.0-rc1~118^2~1), and
commit 357e2ef429 (CheckSoureRuns: Add a unified way to check if a
source runs, 2020-09-14, v3.19.0-rc1~118^2) to work when variables of
the language names are set.
Fixes: #21500
Diffstat (limited to 'Tests/RunCMake')
18 files changed, 36 insertions, 0 deletions
diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake index 095fd54..6483f11 100644 --- a/Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake +++ b/Tests/RunCMake/CheckCompilerFlag/CheckCCompilerFlag.cmake @@ -2,6 +2,8 @@ enable_language (C) include(CheckCompilerFlag) +set(C 1) # test that this is tolerated + check_compiler_flag(C "-_this_is_not_a_flag_" SHOULD_FAIL) if(SHOULD_FAIL) message(SEND_ERROR "invalid C compile flag didn't fail.") diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckCUDACompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCUDACompilerFlag.cmake index a40699c..681a546 100644 --- a/Tests/RunCMake/CheckCompilerFlag/CheckCUDACompilerFlag.cmake +++ b/Tests/RunCMake/CheckCompilerFlag/CheckCUDACompilerFlag.cmake @@ -2,6 +2,8 @@ enable_language (CUDA) include(CheckCompilerFlag) +set(CUDA 1) # test that this is tolerated + check_compiler_flag(CUDA "-_this_is_not_a_flag_" SHOULD_FAIL) if(SHOULD_FAIL) message(SEND_ERROR "invalid CUDA compile flag didn't fail.") diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckCXXCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckCXXCompilerFlag.cmake index bbc104e..60e9755 100644 --- a/Tests/RunCMake/CheckCompilerFlag/CheckCXXCompilerFlag.cmake +++ b/Tests/RunCMake/CheckCompilerFlag/CheckCXXCompilerFlag.cmake @@ -2,6 +2,8 @@ enable_language (CXX) include(CheckCompilerFlag) +set(CXX 1) # test that this is tolerated + check_compiler_flag(CXX "-_this_is_not_a_flag_" SHOULD_FAIL) if(SHOULD_FAIL) message(SEND_ERROR "invalid CXX compile flag didn't fail.") diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckFortranCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckFortranCompilerFlag.cmake index 220ee29..7bb88b1 100644 --- a/Tests/RunCMake/CheckCompilerFlag/CheckFortranCompilerFlag.cmake +++ b/Tests/RunCMake/CheckCompilerFlag/CheckFortranCompilerFlag.cmake @@ -1,6 +1,8 @@ enable_language (Fortran) include(CheckCompilerFlag) +set(Fortran 1) # test that this is tolerated + check_compiler_flag(Fortran "-_this_is_not_a_flag_" SHOULD_FAIL) if(SHOULD_FAIL) message(SEND_ERROR "invalid Fortran compile flag didn't fail.") diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckOBJCCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckOBJCCompilerFlag.cmake index e9344ca..f250f8d 100644 --- a/Tests/RunCMake/CheckCompilerFlag/CheckOBJCCompilerFlag.cmake +++ b/Tests/RunCMake/CheckCompilerFlag/CheckOBJCCompilerFlag.cmake @@ -1,6 +1,8 @@ enable_language (OBJC) include(CheckCompilerFlag) +set(OBJC 1) # test that this is tolerated + check_compiler_flag(OBJC "-_this_is_not_a_flag_" SHOULD_FAIL) if(SHOULD_FAIL) message(SEND_ERROR "invalid OBJC compile flag didn't fail.") diff --git a/Tests/RunCMake/CheckCompilerFlag/CheckOBJCXXCompilerFlag.cmake b/Tests/RunCMake/CheckCompilerFlag/CheckOBJCXXCompilerFlag.cmake index 503a1de..bc940a6 100644 --- a/Tests/RunCMake/CheckCompilerFlag/CheckOBJCXXCompilerFlag.cmake +++ b/Tests/RunCMake/CheckCompilerFlag/CheckOBJCXXCompilerFlag.cmake @@ -1,6 +1,8 @@ enable_language (OBJCXX) include(CheckCompilerFlag) +set(OBJCXX 1) # test that this is tolerated + check_compiler_flag(OBJCXX "-_this_is_not_a_flag_" SHOULD_FAIL) if(SHOULD_FAIL) message(SEND_ERROR "invalid OBJCXX compile flag didn't fail.") diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckCSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckCSourceCompiles.cmake index cf46189..4f73622 100644 --- a/Tests/RunCMake/CheckSourceCompiles/CheckCSourceCompiles.cmake +++ b/Tests/RunCMake/CheckSourceCompiles/CheckCSourceCompiles.cmake @@ -2,6 +2,8 @@ enable_language (C) include(CheckSourceCompiles) +set(C 1) # test that this is tolerated + check_source_compiles(C "I don't build" SHOULD_FAIL) if(SHOULD_FAIL) message(SEND_ERROR "invalid C source didn't fail.") diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckCUDASourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckCUDASourceCompiles.cmake index 1e6e6b2..2190649 100644 --- a/Tests/RunCMake/CheckSourceCompiles/CheckCUDASourceCompiles.cmake +++ b/Tests/RunCMake/CheckSourceCompiles/CheckCUDASourceCompiles.cmake @@ -2,6 +2,8 @@ enable_language (CUDA) include(CheckSourceCompiles) +set(CUDA 1) # test that this is tolerated + check_source_compiles(CUDA "I don't build" SHOULD_FAIL) if(SHOULD_FAIL) message(SEND_ERROR "invalid CUDA source didn't fail.") diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckCXXSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckCXXSourceCompiles.cmake index ec01d42..97c9c30 100644 --- a/Tests/RunCMake/CheckSourceCompiles/CheckCXXSourceCompiles.cmake +++ b/Tests/RunCMake/CheckSourceCompiles/CheckCXXSourceCompiles.cmake @@ -2,6 +2,8 @@ enable_language (CXX) include(CheckSourceCompiles) +set(CXX 1) # test that this is tolerated + check_source_compiles(CXX "I don't build" SHOULD_FAIL) if(SHOULD_FAIL) message(SEND_ERROR "invalid CXX source didn't fail.") diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckFortranSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckFortranSourceCompiles.cmake index 1d4e16d..48dc525 100644 --- a/Tests/RunCMake/CheckSourceCompiles/CheckFortranSourceCompiles.cmake +++ b/Tests/RunCMake/CheckSourceCompiles/CheckFortranSourceCompiles.cmake @@ -3,6 +3,8 @@ enable_language (Fortran) include(CheckSourceCompiles) +set(Fortran 1) # test that this is tolerated + check_source_compiles(Fortran [=[ PROGRAM TEST_HAVE_PRINT PRINT *, 'Hello' diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckOBJCSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckOBJCSourceCompiles.cmake index 2f53cfc4..76a5009 100644 --- a/Tests/RunCMake/CheckSourceCompiles/CheckOBJCSourceCompiles.cmake +++ b/Tests/RunCMake/CheckSourceCompiles/CheckOBJCSourceCompiles.cmake @@ -1,6 +1,8 @@ enable_language (OBJC) include(CheckSourceCompiles) +set(OBJC 1) # test that this is tolerated + check_source_compiles(OBJC [[ #import <Foundation/Foundation.h> int main() { diff --git a/Tests/RunCMake/CheckSourceCompiles/CheckOBJCXXSourceCompiles.cmake b/Tests/RunCMake/CheckSourceCompiles/CheckOBJCXXSourceCompiles.cmake index 805d513..814237e 100644 --- a/Tests/RunCMake/CheckSourceCompiles/CheckOBJCXXSourceCompiles.cmake +++ b/Tests/RunCMake/CheckSourceCompiles/CheckOBJCXXSourceCompiles.cmake @@ -1,6 +1,8 @@ enable_language (OBJCXX) include(CheckSourceCompiles) +set(OBJCXX 1) # test that this is tolerated + check_source_compiles(OBJCXX [[ #include <vector> #import <Foundation/Foundation.h> diff --git a/Tests/RunCMake/CheckSourceRuns/CheckCSourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckCSourceRuns.cmake index 3029ac2..96a1027 100644 --- a/Tests/RunCMake/CheckSourceRuns/CheckCSourceRuns.cmake +++ b/Tests/RunCMake/CheckSourceRuns/CheckCSourceRuns.cmake @@ -2,6 +2,8 @@ enable_language (C) include(CheckSourceRuns) +set(C 1) # test that this is tolerated + check_source_runs(C "int main() {return 2;}" SHOULD_FAIL) if(SHOULD_FAIL) message(SEND_ERROR "C check_source_runs succeeded, but should have failed.") diff --git a/Tests/RunCMake/CheckSourceRuns/CheckCUDASourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckCUDASourceRuns.cmake index 01e5ac8..ea5f4f9 100644 --- a/Tests/RunCMake/CheckSourceRuns/CheckCUDASourceRuns.cmake +++ b/Tests/RunCMake/CheckSourceRuns/CheckCUDASourceRuns.cmake @@ -2,6 +2,8 @@ enable_language (CUDA) include(CheckSourceRuns) +set(CUDA 1) # test that this is tolerated + check_source_runs(CUDA "int main() {return 2;}" SHOULD_FAIL) if(SHOULD_FAIL) message(SEND_ERROR "CUDA check_source_runs succeeded, but should have failed.") diff --git a/Tests/RunCMake/CheckSourceRuns/CheckCXXSourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckCXXSourceRuns.cmake index d47ddda..c4bef6e 100644 --- a/Tests/RunCMake/CheckSourceRuns/CheckCXXSourceRuns.cmake +++ b/Tests/RunCMake/CheckSourceRuns/CheckCXXSourceRuns.cmake @@ -2,6 +2,8 @@ enable_language (CXX) include(CheckSourceRuns) +set(CXX 1) # test that this is tolerated + check_source_runs(CXX "int main() {return 2;}" SHOULD_FAIL) if(SHOULD_FAIL) message(SEND_ERROR "CXX check_source_runs succeeded, but should have failed.") diff --git a/Tests/RunCMake/CheckSourceRuns/CheckFortranSourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckFortranSourceRuns.cmake index 2a1fdfe..50e8ec8 100644 --- a/Tests/RunCMake/CheckSourceRuns/CheckFortranSourceRuns.cmake +++ b/Tests/RunCMake/CheckSourceRuns/CheckFortranSourceRuns.cmake @@ -3,6 +3,8 @@ enable_language (Fortran) include(CheckSourceRuns) +set(Fortran 1) # test that this is tolerated + check_source_runs(Fortran [=[ PROGRAM TEST_HAVE_PRINT PRINT *, 'Hello' diff --git a/Tests/RunCMake/CheckSourceRuns/CheckOBJCSourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckOBJCSourceRuns.cmake index 55f28f3..b828352 100644 --- a/Tests/RunCMake/CheckSourceRuns/CheckOBJCSourceRuns.cmake +++ b/Tests/RunCMake/CheckSourceRuns/CheckOBJCSourceRuns.cmake @@ -1,6 +1,8 @@ enable_language (OBJC) include(CheckSourceRuns) +set(OBJC 1) # test that this is tolerated + check_source_runs(OBJC [[ #import <Foundation/Foundation.h> int main() { diff --git a/Tests/RunCMake/CheckSourceRuns/CheckOBJCXXSourceRuns.cmake b/Tests/RunCMake/CheckSourceRuns/CheckOBJCXXSourceRuns.cmake index a218acd..8a56f13 100644 --- a/Tests/RunCMake/CheckSourceRuns/CheckOBJCXXSourceRuns.cmake +++ b/Tests/RunCMake/CheckSourceRuns/CheckOBJCXXSourceRuns.cmake @@ -1,6 +1,8 @@ enable_language (OBJCXX) include(CheckSourceRuns) +set(OBJCXX 1) # test that this is tolerated + check_source_runs(OBJCXX [[ #include <vector> #import <Foundation/Foundation.h> |