mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-05 13:39:07 +08:00
d0521dadf6
Co-authored-by: Osyotr <8740768+Osyotr@users.noreply.github.com>
17 lines
1.8 KiB
Diff
17 lines
1.8 KiB
Diff
Normally, the build script attempts to create a symlink to fast-discovery-server on Windows
|
|
and only falls back to a batch file if the necessary administrator privileges are not available.
|
|
Since symlinks do not work well with vcpkg binary caching,
|
|
we force the build script to create a batch file in any case.
|
|
diff --git a/tools/fds/CMakeLists.txt b/tools/fds/CMakeLists.txt
|
|
--- a/tools/fds/CMakeLists.txt
|
|
+++ b/tools/fds/CMakeLists.txt
|
|
@@ -116,7 +116,7 @@ # - on windows privileges to create symlinks (a .bat file is provided on unprivileged installations)
|
|
if( WIN32 )
|
|
# Use powershell to generate the link
|
|
install(
|
|
- CODE "execute_process( COMMAND PowerShell -Command \"if( test-path ${PROJECT_NAME}.exe -PathType Leaf ) { rm ${PROJECT_NAME}.exe } ; New-Item -ItemType SymbolicLink -Target $<TARGET_FILE_NAME:${PROJECT_NAME}> -Path ${PROJECT_NAME}.exe \" ERROR_QUIET RESULTS_VARIABLE SYMLINK_FAILED WORKING_DIRECTORY \"${CMAKE_INSTALL_PREFIX}/${BIN_INSTALL_DIR}\") \n if( SYMLINK_FAILED ) \n message(STATUS \"Windows requires admin installation rights to create symlinks. A bat script will be provided instead.\") \n set(FAST_SERVER_BINARY_NAME $<TARGET_FILE_NAME:${PROJECT_NAME}>) \n configure_file(${CMAKE_CURRENT_LIST_DIR}/fast-discovery-server.bat.in ${CMAKE_INSTALL_PREFIX}/${BIN_INSTALL_DIR}${MSVCARCH_DIR_EXTENSION}/${PROJECT_NAME}.bat @ONLY) \n endif()"
|
|
+ CODE "set(FAST_SERVER_BINARY_NAME $<TARGET_FILE_NAME:${PROJECT_NAME}>) \n configure_file(${CMAKE_CURRENT_LIST_DIR}/fast-discovery-server.bat.in ${CMAKE_INSTALL_PREFIX}/${BIN_INSTALL_DIR}${MSVCARCH_DIR_EXTENSION}/${PROJECT_NAME}.bat @ONLY) \n"
|
|
COMPONENT discovery)
|
|
else()
|
|
# Use ln to create the symbolic link. We remove the version from the file name but keep the debug suffix
|