-
Notifications
You must be signed in to change notification settings - Fork 7.5k
[icu] ICU port adds -lm in pkgconfig files for debug MSVC builds #22311
Copy link
Copy link
Closed
Labels
category:port-bugThe issue is with a library, which is something the port should already supportThe issue is with a library, which is something the port should already support
Description
Describe the bug
When ICU is built for Windows (MSVC) target with debug variant, its configure script adds -lm library to Libs.private property of pkgconfig files. As as I know, this library does not exist in MSVC toolchain. It is not used with dynamic linking, but static linking with pkgconfig results in linking error.
Environment
- OS: Windows
- Compiler: MSVC 19.29.30138
To Reproduce
Steps to reproduce the behavior:
- ./vcpkg install icu:x64-windows-static pkgconf:x64-windows-static
- Try to link to static ICU library by using pkgconfig
- Try to build CMake project with following CMakeLists.txt: https://gist.github.com/equeim/851df8e69165e509d9a511d1071e5631,
dummy main.cpp and following CMake configuration command:
cmake -S \path\to\source -B \path\to\build -GNinja -DCMAKE_TOOLCHAIN_FILE=\path\to\vcpkg\scripts\buildsystems\vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DPKG_CONFIG_EXECUTABLE=\path\to\vcpkg\installed\x64-windows-static\tools\pkgconf\pkgconf.exe -DCMAKE_BUILD_TYPE=Debug
- Observe linking error
LINK : fatal error LNK1104: cannot open file 'm.lib'
Expected behavior
Statically linking ICU using pkgconfig should work.
Failure logs
build.log
Additional context
I believe that passing ac_cv_lib_m_floor=no to configure script in icu/portfile.cmake for MSVC toolchain fixes the issue but I don't know whether it is the correct solution.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
category:port-bugThe issue is with a library, which is something the port should already supportThe issue is with a library, which is something the port should already support