Closed grandseiken closed 8 months ago
I managed to run the tests successfully as well after installing cmake and the ClangCl build tools for Visual Studio:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DREFLECTCPP_BUILD_TESTS=ON -G"Visual Studio 17 2022" -T ClangCl
cmake --build build --config Release -j 4
./build/tests/json/Release/reflect-cpp-json-tests.exe
@grandseiken , thank you so much for this PR.
This fixes https://github.com/getml/reflect-cpp/issues/56.
As described in that issue, the
function_name()
obtained fromstd::source_location
on clang on windows does not include template parameters, which means the tricks used by the library to determine names automatically just don't work. However,__PRETTY_FUNCTION__
does contain the template parameters and gives the exact string we wanted.This works whether running clang directly on Windows or whether via
clang-cl
, since both__clang__
and_MSC_VER
are defined in either case.I did a few tests of some basic functionality of the library and everything seemed to work as expected now.