mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-14 16:40:18 +00:00
Simplify compile error tests.
This commit is contained in:
parent
8efc8ac075
commit
6abfb84808
@ -3,11 +3,17 @@
|
|||||||
include(CheckCXXSourceCompiles)
|
include(CheckCXXSourceCompiles)
|
||||||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/..)
|
||||||
|
|
||||||
# Writing a wide character to a character stream Writer is forbidden.
|
function (expect_compile_error code)
|
||||||
check_cxx_source_compiles("
|
check_cxx_source_compiles("
|
||||||
#include \"format.cc\"
|
#include \"format.cc\"
|
||||||
int main() { fmt::Writer() << L'a'; }
|
int main() {
|
||||||
" WRITE_WCHAR_COMPILES)
|
${code}
|
||||||
if (WRITE_WCHAR_COMPILES)
|
}
|
||||||
error("No compile error for: fmt::Writer() << L'a'")
|
" compiles)
|
||||||
endif ()
|
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';")
|
||||||
|
Loading…
Reference in New Issue
Block a user