Replies: 4 comments
-
|
+1 ^ |
Beta Was this translation helpful? Give feedback.
-
|
Hi, I saw that there was changes in scripts/buildsystems/msbuild/applocal.ps1 to the logic that looks for dumpbin. With the new changes, I think it would be preferrable if applocal.ps1 finds dumpbin.exe in a Visual Studio installation using the same logic that is used by bootstrap-vcpkg.bat. |
Beta Was this translation helpful? Give feedback.
-
|
@georg-emg Do you still have the PR you mentioned? If so, can you provide a link to it. Thanks |
Beta Was this translation helpful? Give feedback.
-
|
I used your suggestions and have added the ability to configure a custom dumpbin path to https://github.com/pdehne/vcpkg. This It specifically fixes builds on Windows with Ninja when using the CMake Toolchain files for Windows (https://github.com/MarkSchofield/WindowsToolchain). I used the following configuration. CMakePresets.json: {
"version": 2,
"configurePresets": [
{
"name": "vcpkg",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
}
}
]
}CMakeUserPresets.json: {
"version": 2,
"configurePresets": [
{
"name": "vcpkg-msvc",
"inherits": "vcpkg",
"cacheVariables": {
"VCPKG_CHAINLOAD_TOOLCHAIN_FILE": "C:/d/WindowsToolchain/Windows.MSVC.toolchain.cmake",
"VCPKG_DUMPBIN": "C:/Program Files/Microsoft Visual Studio/18/Community/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/dumpbin.exe"
}
}
]
}For configure and build I run: cmake --preset=vcpkg-msvc -B build
cmake --build buildAll needed dlls are copied to the build folder as part of the build process. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
When creating a cmake toolchain under Windows, all the relevant executables can be specified using cmake variables like
CMAKE_CXX_COMPILERCMAKE_RC_COMPILERCMAKE_MTetc. This allows for writing a toolchain file that can be run from a regular shell without callingvcvarsall.bat, which makes writing CI pipelines a lot easier. These toolchain files can include thevcpkg.cmaketoolchain file to take advantage of the advanced vcpkg features. When trying to use theVCPKG_APPLOCAL_DEPSfeature, however, the scriptapplocal.ps1will attempt to calldumpbinwithout a path. This results in an error ifdumbinis not in the PATH, i.e. ifvcvarsall.bathas not been called.Proposed solution
The
vcpkg.cmaketoockain file could provide a cache variableVCPKG_DUMPBINby callingfind_program(VCPKG_DUMPBIN, dumpbin), and pass the result on toapplocal.ps1as a parameter. This would allow for specifying the path todumpbinfrom the cmake command line, or from a toolchain file.Describe alternatives you've considered
The two possible workarounds are:
vcvarsall.batto be called before building a project that uses vcpkg. This kind of defeats the purpose of a cmake toolchain file, though, which should describe the whole build environment.VCPKG_APPLOCAL_DEPStoOFF, which would be a pity.Additional context
This is just a small change to
scripts/buildsystems/vcpkg.cmakeandscripts/buildsystems/msbuild/applocal.ps1each. I have a working patch and could submit a PR if there is interest.Beta Was this translation helpful? Give feedback.
All reactions