Re: c++ packaging of contour terminal and libunicode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dan Horák wrote:
> another option is to build the internal libs as static, then they won't
> have to be installed. Try appending
> -DBUILD_SHARED_LIBS:BOOL=OFF
> to the cmake flags

I guess this is also why the OP ran into the error with the non-PIC code in 
the static library in the RPM build and not elsewhere. Shared libraries need 
to contain all-PIC code, so both the shared libraries themselves and any 
static libraries linked into them need to be PIC. This is not the case if 
the static libraries are linked only into executables. So if the build has 
only ever been tested with BUILD_SHARED_LIBS off (the upstream CMake 
default), this will not have been caught.

Generally, for an upstream project, it is a better idea to explicitly mark 
the library as STATIC in the CMakeLists.txt files if upstream does not 
support building it as a shared library.

By the way, if upstream is not going to install the static library, they can 
also declare the library as OBJECT instead of STATIC (a CMake-specific 
feature). That creates a kind of virtual static library, where CMake will 
link the object files directly into the target and skip the generation of 
the unnecessary .a file.

        Kevin Kofler
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux