mirror of
https://github.com/vimpunk/mio.git
synced 2025-12-13 15:10:02 +08:00
`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.
16 lines
500 B
CMake
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()
|