mirror of
https://github.com/Kitware/CMake.git
synced 2026-11-06 05:16:58 +00:00
project: Add test for platform variables with a Generic system
Cover that `UNIX`, `LINUX`, and other host platform variables are not defined after `project()` when `CMAKE_SYSTEM_NAME` is `Generic`. Issue: #28200
This commit is contained in:
2 files changed
+6
No files matched your search
@@ -0,0 +1,5 @@
|
||||
foreach(var APPLE UNIX WIN32 CYGWIN MSYS BSD LINUX AIX)
|
||||
if(DEFINED ${var})
|
||||
message(SEND_ERROR "${var} is defined as '${${var}}' for a Generic system.")
|
||||
endif()
|
||||
endforeach()
|
||||
@@ -35,6 +35,7 @@ run_cmake(LanguagesUnordered)
|
||||
if(RunCMake_GENERATOR MATCHES "Make|Ninja")
|
||||
run_cmake(LanguagesUsedButNotEnabled)
|
||||
endif()
|
||||
run_cmake_with_options(PlatformVariablesGeneric -DCMAKE_SYSTEM_NAME=Generic)
|
||||
run_cmake(ProjectCMP0126)
|
||||
run_cmake(ProjectCompatVersion)
|
||||
run_cmake(ProjectCompatVersion2)
|
||||
|
||||
Reference in new issue
Block a user