You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When building the 2.7.0 release tag source statically using CMake on Windows, I found that CMake errored out on installation of the Debug configuration PDB files. The issue seems to stem from the fact that when the GSL libraries are built statically, the PDB files are placed in ${PROJECT_BINARY_DIR}/Debug, not ${PROJECT_BINARY_DIR}/bin/Debug as is expected when building DLLs.
Here are some steps to reproduce my observation. I am using Visual Studio 2019 as the generator here, CMake 3.22, and all these commands are run from a Developer Command Prompt from the AMPL GSL top-level directory.
cmake -S . -B build_windows_x64 -A x64 -DGSL_INSTALL_MULTI_CONFIG=ON -DMSVC_RUNTIME_DYNAMIC=ON -DNO_AMPL_BINDINGS=1
Since the listed PDB files are rather in ${PROJECT_BINARY_DIR}/Debug with the GSL .lib static libraries instead of listed directory ${PROJECT_BINARY_DIR}/bin/Debug, this install command fails because the PDB files won't be found. To work around this on my end, I modified the CMakeLists.txt at that location with some extra logic to instead read as follows:
Making this modification resulted in PDB file installation to lib\Debug of my chosen installation root as desired. However, I decided to make an issue about this to get some feedback on whether or not this is the approach to take here.
The text was updated successfully, but these errors were encountered:
Hi,
When building the 2.7.0 release tag source statically using CMake on Windows, I found that CMake errored out on installation of the Debug configuration PDB files. The issue seems to stem from the fact that when the GSL libraries are built statically, the PDB files are placed in
${PROJECT_BINARY_DIR}/Debug
, not${PROJECT_BINARY_DIR}/bin/Debug
as is expected when building DLLs.Here are some steps to reproduce my observation. I am using Visual Studio 2019 as the generator here, CMake 3.22, and all these commands are run from a Developer Command Prompt from the AMPL GSL top-level directory.
cmake -S . -B build_windows_x64 -A x64 -DGSL_INSTALL_MULTI_CONFIG=ON -DMSVC_RUNTIME_DYNAMIC=ON -DNO_AMPL_BINDINGS=1
cmake --build build_windows_x64 --config Debug -j
cmake --install build_windows_x64 --prefix install_windows_x64 --config Debug
Step 3. will error out with the following message from the generated
cmake_install.cmake
:Fortunately, I was able to quickly trace the problem to this chunk in the top-level
CMakeLists.txt
in themaster
branch:gsl/CMakeLists.txt
Lines 865 to 872 in 60539d2
Since the listed PDB files are rather in
${PROJECT_BINARY_DIR}/Debug
with the GSL.lib
static libraries instead of listed directory${PROJECT_BINARY_DIR}/bin/Debug
, thisinstall
command fails because the PDB files won't be found. To work around this on my end, I modified theCMakeLists.txt
at that location with some extra logic to instead read as follows:Making this modification resulted in PDB file installation to
lib\Debug
of my chosen installation root as desired. However, I decided to make an issue about this to get some feedback on whether or not this is the approach to take here.The text was updated successfully, but these errors were encountered: