Force MSVC to compile in utf-8 mode

MSVC by default uses the local codepage, which fails when it sees the
utf-8 in test_python_types.cpp.  This adds the /utf-8 flag to the test
suite compilation to force it to interpret source code as utf-8.

Fixes #869
This commit is contained in:
Jason Rhinelander 2017-05-25 01:05:49 -04:00
parent f3ce00eaed
commit 8dc63ba941

View File

@ -128,6 +128,10 @@ pybind11_add_module(pybind11_tests THIN_LTO pybind11_tests.cpp
pybind11_enable_warnings(pybind11_tests)
if(MSVC)
target_compile_options(pybind11_tests PRIVATE /utf-8)
endif()
if(EIGEN3_FOUND)
if (PYBIND11_EIGEN_VIA_TARGET)
target_link_libraries(pybind11_tests PRIVATE Eigen3::Eigen)