mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
Do not copy the list of enabled languages from the outer generator. It is populated as languages are enabled inside the test project. Fixes: #27684
12 lines
339 B
CMake
12 lines
339 B
CMake
enable_language (C CXX)
|
|
include(CheckSourceCompiles)
|
|
|
|
add_library(cxx_iface INTERFACE IMPORTED)
|
|
target_compile_features(cxx_iface INTERFACE cxx_std_11)
|
|
set(CMAKE_REQUIRED_LIBRARIES cxx_iface)
|
|
|
|
check_source_compiles(C "int main() {return 0;}" SHOULD_BUILD)
|
|
if(NOT SHOULD_BUILD)
|
|
message(SEND_ERROR "Test fail for valid C source.")
|
|
endif()
|