Environment
- OS: Windows
- Compiler: MSVC (Visual Studio 17 2022)
- Architecture: x64
- vcpkg: Latest version (installed at C:\vcpkg)
- Windows SDK: 10.0.26100.0
Issue Description
The project fails to build on Windows using MSVC with vcpkg toolchain due to a maximum recursion depth error in vcpkg.cmake.
Steps to Reproduce
-
Install vcpkg:
git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg
cd C:\vcpkg
.\bootstrap-vcpkg.bat
.\vcpkg integrate install
-
Install required dependencies:
.\vcpkg install openssl:x64-windows
.\vcpkg install zlib:x64-windows
.\vcpkg install zeromq:x64-windows
-
Configure the project:
cd D:\study\opencmw-cpp-example
cmake -S . -B build ^
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake ^
-G "Visual Studio 17 2022" -A x64
Error Output
-- Running vcpkg install - done
-- Selecting Windows SDK version 10.0.26100.0 to target Windows 6.2.9200.
-- No colored compiler diagnostic set for 'MSVC' compiler.
WARNNo version check for your compiler (MSVC) implemented, in case of build problems consider updating your compiler or check if you can switch to gcc or clang
CMake Error at C:/vcpkg/scripts/buildsystems/vcpkg.cmake:152 (if):
Maximum recursion depth of 1000 exceeded
Call Stack (most recent call first):
C:/vcpkg/scripts/buildsystems/vcpkg.cmake:640 (z_vcpkg_function_arguments)
C:/vcpkg/scripts/buildsystems/vcpkg.cmake:641 (_add_library)
C:/vcpkg/scripts/buildsystems/vcpkg.cmake:641 (_add_library)
C:/vcpkg/scripts/buildsystems/vcpkg.cmake:641 (_add_library)
[... repeated many times ...]
CMakeLists.txt:26 (add_library)
-- Configuring incomplete, errors occurred!
Expected Behavior
The project should configure and build successfully on Windows with MSVC using vcpkg.
Additional Information
- The warning mentions "No version check for your compiler (MSVC) implemented"
- The recursion occurs in the vcpkg toolchain file when processing
add_library calls
- The error originates from line 26 in CMakeLists.txt
Possible Solutions to Investigate
- Check for CMakeLists.txt compatibility with vcpkg toolchain
- Verify if there are any circular dependencies in the build configuration
- Consider alternative build approaches for Windows/MSVC environment
Any guidance on resolving this MSVC build issue would be greatly appreciated.
Environment
Issue Description
The project fails to build on Windows using MSVC with vcpkg toolchain due to a maximum recursion depth error in vcpkg.cmake.
Steps to Reproduce
Install vcpkg:
Install required dependencies:
Configure the project:
Error Output
Expected Behavior
The project should configure and build successfully on Windows with MSVC using vcpkg.
Additional Information
add_librarycallsPossible Solutions to Investigate
Any guidance on resolving this MSVC build issue would be greatly appreciated.