Dear Albert,

But we do have such switch already, no? I mean that is what -
DBUILD_SHARED_LIBS=OFF is supposed to do ?

It's slightly different, in 2 points:

a) current CMakeFiles.txt can build libpoppler.a by DBUILD_SHARED_LIBS=OFF,
but cpp, glib, qt5 frontends are hardcoded to be shared library.

b) some binary package maintainers (might) want to have a switch
which builds both of shared + archive library by single build
process. the current assumption building archive library by disabling
shared library doubles the building process. maybe the expected
situation would be:
default: only shared library is built.
optional: both of shared + archive libraries are built.

--

Here I attach small patch fixing a) issue only. Also, g-introspection
requires the shared library, attached patch disables the target
of the introspection if shared library is disabled. How do you feel?

Regards,
mpsuzuki



Albert Astals Cid wrote:
El dijous, 11 de gener de 2018, a les 11:26:08 CET, suzuki toshiya va escriure:
Dear Albert,

Albert Astals Cid wrote:
El dijous, 11 de gener de 2018, a les 0:34:25 CET, suzuki toshiya va
escriure:
Dear Albert,

Thank you for consideration about the archive library issue.

So this patch doubles compilation time because everything is compiled
twice?

I don't think i want that.
When poppler was built by autoconf, always (on the platform supporting
both of shared & archive libraries) a source was compiled twice, one
for shared and another for archive, because autoconf enables both
libraries
by default. So I think this is not critical regression which has never
happened. Maybe it was very popular cases in 3 months ago.
I never used autoconf, so it's a very strong regression for me.
Oh ¯\_(ツ)_/¯

But, if the majority of poppler maintainers are unwilling to make
"one-source-twice-compiling" as the default building (because they are
not interested in the archive library), I propose to include the switch
to compile archive libraries which is set to off by default. I think
even such switch (set to off by default) is still helpful.
Compiling the source twice is not acceptable, makes my development cycle
twice as long for no reason at all.
Do you think even the switch which is set to off by default (only
compiling for shared library by default) is unacceptable?

But we do have such switch already, no? I mean that is what -
DBUILD_SHARED_LIBS=OFF is supposed to do ?

Cheers,
  Albert

Regards,
mpsuzuki

Cheers,

  Albert
Regards,
mpsuzuki

Albert Astals Cid wrote:
El dimecres, 1 de novembre de 2017, a les 11:55:41 CET, Jeroen Ooms va

escriure:
Several projects use static builds of poppler-cpp to ship standalone
pdf applications, but since the switch to cmake it is no longer
possible to build static libs.

Setting -DBUILD_SHARED_LIBS=OFF in cmake only builds a static
libpoppler.a, however libpoppler-cpp still gets built as a dynamic
library (because SHARED is hardcoded in CMakeLists.txt).

It would be really great of cmake could build both the static and the
shared libraries, like many other C/C++ libs do. The patch below

implements this:
  Human readable view:
https://github.com/tsdgeos/poppler_mirror/pull/2/files Patch file:
https://github.com/tsdgeos/poppler_mirror/pull/2.patch

What can I do to get this patch reviewed?
So this patch doubles compilation time because everything is compiled
twice?

I don't think i want that.

Cheers,

  Albert
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler


_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler

diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 1fb20bb..a4873cf 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -22,7 +22,7 @@ set(poppler_cpp_SRCS
   poppler-version.cpp
 )
 
-add_library(poppler-cpp SHARED ${poppler_cpp_SRCS})
+add_library(poppler-cpp ${poppler_cpp_SRCS})
 set_target_properties(poppler-cpp PROPERTIES VERSION 0.3.0 SOVERSION 0)
 if(MINGW)
     get_target_property(POPPLER_CPP_SOVERSION poppler-cpp SOVERSION)
diff --git a/glib/CMakeLists.txt b/glib/CMakeLists.txt
index 9a09d7a..33c6608 100644
--- a/glib/CMakeLists.txt
+++ b/glib/CMakeLists.txt
@@ -84,7 +84,7 @@ set(poppler_glib_generated_SRCS
   ${CMAKE_SOURCE_DIR}/poppler/CairoOutputDev.cc
   ${CMAKE_SOURCE_DIR}/poppler/CairoRescaleBox.cc
 )
-add_library(poppler-glib SHARED ${poppler_glib_SRCS} ${poppler_glib_generated_SRCS})
+add_library(poppler-glib ${poppler_glib_SRCS} ${poppler_glib_generated_SRCS})
 set_target_properties(poppler-glib PROPERTIES VERSION 8.9.0 SOVERSION 8)
 if(MINGW)
     get_target_property(POPPLER_GLIB_SOVERSION poppler-glib SOVERSION)
@@ -115,7 +115,7 @@ macro(_list_prefix _outvar _listvar _prefix)
 endmacro(_list_prefix)
 
 # GObject Introspection
-if (HAVE_INTROSPECTION)
+if (HAVE_INTROSPECTION AND BUILD_SHARED_LIBS)
   include(GObjectIntrospectionMacros)
   set(INTROSPECTION_GIRS)
   set(INTROSPECTION_SCANNER_ARGS "--add-include-path=${CMAKE_CURRENT_SOURCE_DIR} --warn-all")
diff --git a/qt5/src/CMakeLists.txt b/qt5/src/CMakeLists.txt
index b54b025..63757c6 100644
--- a/qt5/src/CMakeLists.txt
+++ b/qt5/src/CMakeLists.txt
@@ -29,7 +29,7 @@ set(poppler_qt5_SRCS
   poppler-media.cc
   ArthurOutputDev.cc
 )
-add_library(poppler-qt5 SHARED ${poppler_qt5_SRCS})
+add_library(poppler-qt5 ${poppler_qt5_SRCS})
 set_target_properties(poppler-qt5 PROPERTIES VERSION 1.12.0 SOVERSION 1)
 if(MINGW)
     get_target_property(POPPLER_QT5_SOVERSION poppler-qt5 SOVERSION)
_______________________________________________
poppler mailing list
poppler@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to