From 5a77c9037ea76d3d3cf7265873a7ddc144534d39 Mon Sep 17 00:00:00 2001 From: lethosor Date: Fri, 21 Aug 2020 19:49:33 -0400 Subject: [PATCH] Pass CMAKE_GENERATOR_TOOLSET (cmake -T argument) to external projects The dependencies introduced in #1620 cause an error when building natively on Windows, according to @ragundo. CMake is looking for build tools `v100`, which are part of VS2010 and won't work with DF/DFHack, even if they were installed. Some of the Windows build scripts pass in `-T v140_xp` (from VS2015), so passing this option through to subprojects may help: https://cmake.org/cmake/help/latest/variable/CMAKE_GENERATOR_TOOLSET.html --- depends/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/depends/CMakeLists.txt b/depends/CMakeLists.txt index 2437794bb..118659b3b 100644 --- a/depends/CMakeLists.txt +++ b/depends/CMakeLists.txt @@ -19,6 +19,10 @@ add_subdirectory(clsocket) ide_folder(clsocket "Depends") # assemble environment args to pass on to dependency projects +if (NOT("${CMAKE_GENERATOR_TOOLSET}" STREQUAL "")) + list(APPEND CL_ARGS "-T" "${CMAKE_GENERATOR_TOOLSET}") +endif() + get_cmake_property(vars CACHE_VARIABLES) foreach(var ${vars}) if(var MATCHES "^CMAKE_"