mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
Give `try_compile` callers a way to control the `CXX_STANDARD`, `CXX_STANDARD_REQUIRED`, and `CXX_EXTENSIONS` properties of the generated test target (or the `C` equivalents) in order to compile a test source for a particular language standard. Issue: #16456
8 lines
190 B
CMake
8 lines
190 B
CMake
enable_language(C)
|
|
try_compile(result ${CMAKE_CURRENT_BINARY_DIR}
|
|
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src.c
|
|
C_STANDARD 3
|
|
OUTPUT_VARIABLE out
|
|
)
|
|
message("try_compile output:\n${out}")
|