File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -43,14 +43,6 @@ include("${ProjectOptions_SRC_DIR}/DetectCompiler.cmake")
4343include ("${ProjectOptions_SRC_DIR} /CrossCompiler.cmake" )
4444include ("${ProjectOptions_SRC_DIR} /DynamicProjectOptions.cmake" )
4545include ("${ProjectOptions_SRC_DIR} /Hardening.cmake" )
46-
47- # Include msvc toolchain on windows if the generator is not visual studio. Should be called before run_vcpkg and run_conan to be effective
48- if ("${CMAKE_TOOLCHAIN_FILE} " STREQUAL "" )
49- msvc_toolchain()
50- else ()
51- message (STATUS "project_options: skipping msvc_toolchain as CMAKE_TOOLCHAIN_FILE is set" )
52- endif ()
53-
5446include ("${ProjectOptions_SRC_DIR} /Conan.cmake" )
5547include ("${ProjectOptions_SRC_DIR} /Vcpkg.cmake" )
5648
Original file line number Diff line number Diff line change @@ -46,7 +46,21 @@ function(is_msvc value)
4646 set (${value} OFF PARENT_SCOPE)
4747endfunction ()
4848
49- # Include msvc toolchain on windows if the generator is not visual studio. Should be called before run_vcpkg and run_conan to be effective
49+ #[[.rst:
50+
51+ ``msvc_toolchain``
52+ ===============
53+
54+ Include msvc toolchain on windows if the generator is not visual studio. Should be called before run_vcpkg and run_conan to be effective
55+
56+ Notes: if running in a cross-compilation situation, the toolchain might not work as expected. So add proper if-checks if you have such a configuration
57+
58+ .. code:: cmake
59+
60+ msvc_toolchain()
61+ # should be included before run_vcpkg/run_conan to be effective
62+
63+ ]]
5064macro (msvc_toolchain)
5165 if (# if on windows and the generator is not Visual Studio
5266 WIN32 AND NOT CMAKE_GENERATOR MATCHES "Visual Studio*"
You can’t perform that action at this time.
0 commit comments