mirror of
https://github.com/fmtlib/fmt.git
synced 2024-10-01 20:42:02 +00:00
20 lines
489 B
CMake
20 lines
489 B
CMake
# Test if compile errors are produced where necessary.
|
|
|
|
include(CheckCXXSourceCompiles)
|
|
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
|
|
|
function (expect_compile_error code)
|
|
check_cxx_source_compiles("
|
|
#include \"format.cc\"
|
|
int main() {
|
|
${code}
|
|
}
|
|
" compiles)
|
|
if (compiles)
|
|
error("No compile error for: ${code}")
|
|
endif ()
|
|
endfunction ()
|
|
|
|
# Writing a wide character to a character stream Writer is forbidden.
|
|
expect_compile_error("fmt::Writer() << L'a';")
|