Imported Upstream version 3.25.0
[platform/upstream/cmake.git] / Tests / RunCMake / try_compile / old_and_new_signature_tests.cmake
1 # These tests are performed using both the historic and the newer SOURCES
2 # signatures of try_compile. It is critical that they behave the same and
3 # produce comparable output for both signatures. Tests that cannot do this
4 # belong in RunCMakeTests.txt, not here.
5 #
6 # Tests here MUST include(${CMAKE_CURRENT_SOURCE_DIR}/${try_compile_DEFS}) and
7 # use the variables defined therein appropriately. Refer to existing tests for
8 # examples.
9
10 run_cmake(CopyFileErrorNoCopyFile)
11 run_cmake(NoCopyFile)
12 run_cmake(NoCopyFile2)
13 run_cmake(NoCopyFileError)
14 run_cmake(NoCStandard)
15 run_cmake(NoOutputVariable)
16 run_cmake(NoOutputVariable2)
17 run_cmake(BadLinkLibraries)
18 run_cmake(BadSources1)
19 run_cmake(BadSources2)
20 run_cmake(EmptyValueArgs)
21 run_cmake(EmptyListArgs)
22 run_cmake(TryRunArgs)
23 run_cmake(BuildType)
24 run_cmake(BuildTypeAsFlag)
25 run_cmake(OutputDirAsFlag)
26
27 run_cmake(EnvConfig)
28
29 run_cmake(TargetTypeExe)
30 run_cmake(TargetTypeInvalid)
31 run_cmake(TargetTypeStatic)
32
33 if(CMAKE_C_STANDARD_DEFAULT)
34   run_cmake(CStandard)
35 elseif(DEFINED CMAKE_C_STANDARD_DEFAULT)
36   run_cmake(CStandardNoDefault)
37 endif()
38 if(CMAKE_OBJC_STANDARD_DEFAULT)
39   run_cmake(ObjCStandard)
40 endif()
41 if(CMAKE_CXX_STANDARD_DEFAULT)
42   run_cmake(CxxStandard)
43 elseif(DEFINED CMAKE_CXX_STANDARD_DEFAULT)
44   run_cmake(CxxStandardNoDefault)
45 endif()
46 if(CMAKE_OBJCXX_STANDARD_DEFAULT)
47   run_cmake(ObjCxxStandard)
48 endif()
49 if(CMake_TEST_CUDA)
50   run_cmake(CudaStandard)
51 endif()
52 if(CMake_TEST_ISPC)
53   run_cmake(ISPCTargets)
54   run_cmake(ISPCInvalidTarget)
55   set(ninja "")
56   if(RunCMake_GENERATOR MATCHES "Ninja")
57     set(ninja "Ninja")
58   endif()
59   run_cmake(ISPCDuplicateTarget${ninja})
60 endif()
61 if((CMAKE_C_COMPILER_ID MATCHES "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4) OR CMAKE_C_COMPILER_ID MATCHES "LCC")
62   run_cmake(CStandardGNU)
63 endif()
64 if((CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) OR CMAKE_C_COMPILER_ID MATCHES "LCC")
65   run_cmake(CxxStandardGNU)
66 endif()