Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-9541

[C++] CMakeLists requires UTF8PROC_STATIC when building static library

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0.0
    • 2.0.0
    • C++

    Description

      Arrow does not correctly link with utf8proc if UTF8PROC_STATIC is not specified when creating a static library, the library will contain unresolved symbols to a DLL import library.

      AFAIK this only happens on Windows (Visual Studio) but in theory the flag should probably be specified for all platform. I suspect that in practice only MSVC is impacted. There is already an existing section in `CMakeLists.txt` covering this problem for Arrow itself.

      See https://github.com/microsoft/vcpkg/pull/12537/files for an example patch. In particular (line 149 of CMakeLists.txt):

       if(ARROW_BUILD_STATIC AND WIN32)
         target_compile_definitions(arrow_static PUBLIC ARROW_STATIC)
      +  if(ARROW_WITH_UTF8PROC)
      +    target_compile_definitions(arrow_static PUBLIC UTF8PROC_STATIC)
      +  endif()
       endif()
      

      Attachments

        Issue Links

          Activity

            People

              tanguyf Tanguy Fautre
              GPSnoopy Tanguy Fautre
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 20m
                  2h 20m