mio/test/CMakeLists.txt
Greg Beard 0082811090 Changes Windows version to directly use CreateFileA
`CreateFile` is `#define`d as `CreateFileW` in unicode builds (when `/D
UNICODE` is defined). This is probably more likely to be a issue when
integrating into GUI projects.

This commit allows compilation to succeed when `UNICODE` has been
defined and adds a note to the README, explicitly stating that mio
doesn't support wide char string types as parameters.
2018-10-18 13:01:55 +01:00

16 lines
500 B
CMake

add_executable(mio.test test.cpp)
target_link_libraries(mio.test PRIVATE mio::mio)
add_test(NAME mio.test COMMAND mio.test)
if(WIN32)
add_executable(mio.unicode.test unicode_test.cpp)
target_link_libraries(mio.unicode.test PRIVATE mio::mio)
target_compile_options(
mio.unicode.test
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/Zc:wchar_t>
)
target_compile_definitions(mio.unicode.test PRIVATE UNICODE)
add_test(NAME mio.unicode.test COMMAND mio.test)
endif()