--disable-shared-libs has no effect #166

Closed
opened 2026-01-29 20:39:08 +00:00 by claunia · 12 comments
Owner

Originally created by @JoeUser78 on GitHub (Apr 26, 2017).

Compiling 0.6.0 with cmake and --disable-sharesd-libs as documented in the README has absolutly no effect.
What is the correct way to build static libs and binary for 0.6.0 with cmake?

Originally created by @JoeUser78 on GitHub (Apr 26, 2017). Compiling 0.6.0 with cmake and --disable-sharesd-libs as documented in the README has absolutly no effect. What is the correct way to build static libs and binary for 0.6.0 with cmake?
Author
Owner

@JoeUser78 commented on GitHub (Apr 26, 2017):

Corresponding FreeBSD bugreport:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218851

@JoeUser78 commented on GitHub (Apr 26, 2017): Corresponding FreeBSD bugreport: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=218851
Author
Owner

@eustas commented on GitHub (Apr 26, 2017):

Going to investigate ASAP (== tomorrow)

@eustas commented on GitHub (Apr 26, 2017): Going to investigate ASAP (== tomorrow)
Author
Owner

@eustas commented on GitHub (Apr 26, 2017):

Current workaround for simple build cases would be:

  • cmake . && make for static libraries
  • cmake . -DBUILD_SHARED_LIBS=ON && make for shared libraries

Digging further, why this machinery doesn't work as expected.

@eustas commented on GitHub (Apr 26, 2017): Current workaround for simple build cases would be: * `cmake . && make` for static libraries * `cmake . -DBUILD_SHARED_LIBS=ON && make` for shared libraries Digging further, why this machinery doesn't work as expected.
Author
Owner

@JoeUser78 commented on GitHub (Apr 26, 2017):

OK, -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON did it, thanks.

@JoeUser78 commented on GitHub (Apr 26, 2017): OK, -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON did it, thanks.
Author
Owner

@eustas commented on GitHub (Apr 26, 2017):

Thanks for the report. Going to update readme, and, most probably, release 0.6.1 after fixing buildfiles.

Line CMAKE_DEPENDENT_OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON "NOT BROTLI_BUNDLED_MODE" OFF) is read as "if not in bundled mode (== top level project) then, by default, set BUILD_SHARED_LIBS=ON". For some reason, this magic didn't happen. That is what configure-cmake flag has no effect.

@eustas commented on GitHub (Apr 26, 2017): Thanks for the report. Going to update readme, and, most probably, release 0.6.1 after fixing buildfiles. Line `CMAKE_DEPENDENT_OPTION(BUILD_SHARED_LIBS "Build shared libraries" ON "NOT BROTLI_BUNDLED_MODE" OFF)` is read as "if not in bundled mode (== top level project) then, by default, set BUILD_SHARED_LIBS=ON". For some reason, this magic didn't happen. That is what configure-cmake flag has no effect.
Author
Owner

@JoeUser78 commented on GitHub (Apr 26, 2017):

Thanks for your realy fast response and fix.

@JoeUser78 commented on GitHub (Apr 26, 2017): Thanks for your realy fast response and fix.
Author
Owner

@eustas commented on GitHub (Apr 27, 2017):

Oh, I have a guess what has happened! CMake is a very nasty build system. If you occasionally use it in root project folder - you poison it. CMake will cache some variables and do unexpected things based on cached values.

That is why there is mkdir out && cd out and mkdir out-static && cd static-out in readme.

To cure the poisoned repository try git reset --hard && git clean -dfx.

@eustas commented on GitHub (Apr 27, 2017): Oh, I have a guess what has happened! CMake is a very nasty build system. If you occasionally use it in root project folder - you poison it. CMake will cache some variables and do unexpected things based on cached values. That is why there is `mkdir out && cd out` and `mkdir out-static && cd static-out` in readme. To cure the poisoned repository try `git reset --hard && git clean -dfx`.
Author
Owner

@JoeUser78 commented on GitHub (Apr 27, 2017):

My builds had always been out-of-source builds (FreeBSDs Ports Makefile option USES=cmake:outsource), so that this is not the course of the issue. Also i'm not using git but the released source code archive (v0.6.0.tar.gz).

@JoeUser78 commented on GitHub (Apr 27, 2017): My builds had always been out-of-source builds (FreeBSDs Ports Makefile option `USES=cmake:outsource`), so that this is not the course of the issue. Also i'm not using git but the released source code archive (`v0.6.0.tar.gz`).
Author
Owner

@osokin commented on GitHub (Apr 27, 2017):

Hi,

actually we'd like to see both types of libraries (shared and static) like other ports do.

Is there any chance to see three types of a build, i.e. SHARED, STATIC, COMBINED (SHARED_AND_STATIC).

Thanks in advance.

@osokin commented on GitHub (Apr 27, 2017): Hi, actually we'd like to see both types of libraries (shared and static) like other ports do. Is there any chance to see three types of a build, i.e. SHARED, STATIC, COMBINED (SHARED_AND_STATIC). Thanks in advance.
Author
Owner

@eustas commented on GitHub (Apr 27, 2017):

Going to see, if it is possible. If you point to a sample project with CMake build, that features such option, it will help greatly.

@eustas commented on GitHub (Apr 27, 2017): Going to see, if it is possible. If you point to a sample project with CMake build, that features such option, it will help greatly.
Author
Owner

@JoeUser78 commented on GitHub (May 2, 2017):

https://cmake.org/Wiki/CMake_FAQ#Library_questions should help a bit.

@JoeUser78 commented on GitHub (May 2, 2017): https://cmake.org/Wiki/CMake_FAQ#Library_questions should help a bit.
Author
Owner

@eustas commented on GitHub (Sep 19, 2017):

Updated cmake to build both shared and static libraries the same time

@eustas commented on GitHub (Sep 19, 2017): Updated cmake to build both shared and static libraries the same time
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/brotli#166