Files
CMake/Tests/RunCMake/project/LanguagesDuplicate.cmake
friendlyanon b4fd385c9b cmMakefile: Dedupe languages when enabling them
cmMakefile::EnableLanguage() now deduplicates the languages argument and
emits an author warning listing the languages that were defined multiple
times in a single call.

Fixes: #23596
2022-06-30 23:37:05 +02:00

12 lines
282 B
CMake

cmake_policy(SET CMP0057 NEW)
project(ProjectA C C C)
project(ProjectB C C CXX CXX)
get_property(langs GLOBAL PROPERTY ENABLED_LANGUAGES)
foreach(lang C CXX)
if(NOT lang IN_LIST langs)
message(FATAL_ERROR "Expected language '${lang}' to be enabled.")
endif()
endforeach()