mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-15 01:58:14 +08:00
[vcpkg.cmake] error out if the mode has changed (#13313)
This commit is contained in:
parent
ff1d20fd9a
commit
619b294700
@ -5,6 +5,8 @@ mark_as_advanced(CMAKE_TOOLCHAIN_FILE)
|
|||||||
option(VCPKG_VERBOSE "Enables messages from the VCPKG toolchain for debugging purposes." OFF)
|
option(VCPKG_VERBOSE "Enables messages from the VCPKG toolchain for debugging purposes." OFF)
|
||||||
mark_as_advanced(VCPKG_VERBOSE)
|
mark_as_advanced(VCPKG_VERBOSE)
|
||||||
|
|
||||||
|
include(CMakeDependentOption)
|
||||||
|
|
||||||
function(_vcpkg_get_directory_name_of_file_above OUT DIRECTORY FILENAME)
|
function(_vcpkg_get_directory_name_of_file_above OUT DIRECTORY FILENAME)
|
||||||
set(_vcpkg_get_dir_candidate ${DIRECTORY})
|
set(_vcpkg_get_dir_candidate ${DIRECTORY})
|
||||||
while(IS_DIRECTORY ${_vcpkg_get_dir_candidate} AND NOT DEFINED _vcpkg_get_dir_out)
|
while(IS_DIRECTORY ${_vcpkg_get_dir_candidate} AND NOT DEFINED _vcpkg_get_dir_out)
|
||||||
@ -43,15 +45,26 @@ elseif(VCPKG_MANIFEST_MODE AND NOT _VCPKG_MANIFEST_DIR)
|
|||||||
"disable manifests by turning off VCPKG_MANIFEST_MODE.")
|
"disable manifests by turning off VCPKG_MANIFEST_MODE.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(VCPKG_MANIFEST_MODE)
|
if(NOT DEFINED _INTERNAL_CHECK_VCPKG_MANIFEST_MODE)
|
||||||
option(VCPKG_MANIFEST_INSTALL
|
set(_INTERNAL_CHECK_VCPKG_MANIFEST_MODE "${VCPKG_MANIFEST_MODE}"
|
||||||
[[
|
CACHE INTERNAL "Making sure VCPKG_MANIFEST_MODE doesn't change")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT VCPKG_MANIFEST_MODE STREQUAL _INTERNAL_CHECK_VCPKG_MANIFEST_MODE)
|
||||||
|
message(FATAL_ERROR [[
|
||||||
|
vcpkg manifest mode was enabled for a build directory where it was initially disabled.
|
||||||
|
This is not supported. Please delete the build directory and reconfigure.
|
||||||
|
]])
|
||||||
|
endif()
|
||||||
|
|
||||||
|
CMAKE_DEPENDENT_OPTION(VCPKG_MANIFEST_INSTALL [[
|
||||||
Install the dependencies listed in your manifest:
|
Install the dependencies listed in your manifest:
|
||||||
If this is off, you will have to manually install your dependencies.
|
If this is off, you will have to manually install your dependencies.
|
||||||
See https://github.com/microsoft/vcpkg/tree/master/docs/specifications/manifests.md for more info.
|
See https://github.com/microsoft/vcpkg/tree/master/docs/specifications/manifests.md for more info.
|
||||||
]]
|
]]
|
||||||
ON)
|
ON
|
||||||
endif()
|
"VCPKG_MANIFEST_MODE"
|
||||||
|
OFF)
|
||||||
|
|
||||||
# Determine whether the toolchain is loaded during a try-compile configuration
|
# Determine whether the toolchain is loaded during a try-compile configuration
|
||||||
get_property(_CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE)
|
get_property(_CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user