Skip to content

Commit cc042c9

Browse files
authored
CMAKE_VS_PLATFORM_TOOLSET might be empty (simdjson#1009)
According to https://gitlab.kitware.com/cmake/cmake/-/issues/17976, CMAKE_VS_PLATFORM_TOOLSET is set only when using a Visual Studio generator. When we use Ninja as the generator, CMAKE_VS_PLATFORM_TOOLSET will be empty. As a result: if(${CMAKE_VS_PLATFORM_TOOLSET} STREQUAL "v140") will be treated as: if( STREQUAL "v140") We may also quote it like this: if("${CMAKE_VS_PLATFORM_TOOLSET}" STREQUAL "v140") but that won't make the warnings disappeared in VS2015.
1 parent 599e3bc commit cc042c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmake/simdjson-flags.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
7777

7878

7979
if(MSVC)
80-
if(${CMAKE_VS_PLATFORM_TOOLSET} STREQUAL "v140")
80+
if("${MSVC_TOOLSET_VERSION}" STREQUAL "140")
8181
# Visual Studio 2015 issues warnings and we tolerate it, cmake -G"Visual Studio 14" ..
8282
target_compile_options(simdjson-internal-flags INTERFACE /W0 /sdl)
8383
else()

0 commit comments

Comments
 (0)