From 8bd2ff33b87bae1db644b473a6e6055118cf7131 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Thu, 2 Nov 2017 18:37:43 +0100 Subject: Make shared library building an option --- CMakeLists.txt | 1 + src/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b01956876..09519c8ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,7 @@ option(WITH_LPETOOL "Compile with LPE Tool and experimental LPEs enabled" ON) option(WITH_OPENMP "Compile with OpenMP support" ON) option(WITH_PROFILING "Turn on profiling" OFF) # Set to true if compiler/linker should enable profiling +option(BUILD_SHARED_LIBS "Compile libraries as shared and not static" ON) option(ENABLE_POPPLER "Compile with support of libpoppler" ON) option(ENABLE_POPPLER_CAIRO "Compile with support of libpoppler-cairo for rendering PDF preview (depends on ENABLE_POPPLER)" ON) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 72d984845..4c56b211d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -540,7 +540,7 @@ set(INKSCAPE_TARGET_LIBS ) # Build everything except main and inkview.c in a shared library. -add_library(inkscape_base SHARED ${inkscape_SRC} ${sp_SRC}) +add_library(inkscape_base ${inkscape_SRC} ${sp_SRC}) if(WITH_DBUS) add_dependencies(inkscape_base inkscape_dbus) -- cgit v1.2.3 From 4e991ba74afefc4595c748a9435fc5a07f1c67d4 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Thu, 2 Nov 2017 19:20:46 +0100 Subject: do not build grid2 in target all --- CMakeLists.txt | 2 +- src/extension/plugins/grid2/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09519c8ac..a1a68d4e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,7 +148,7 @@ add_definitions(-DORBIT2=1) add_definitions(-DHAVE_CONFIG_H) add_definitions(-DHAVE_CAIRO_PDF=1) # needed for src/libnrtype/Layout-TNG.h add_definitions(-DHAVE_TR1_UNORDERED_SET) # XXX make an option! -if(NOT WIN32) +if(BUILD_SHARED_LIBS AND NOT WIN32) add_definitions(-fPIC) endif() # diff --git a/src/extension/plugins/grid2/CMakeLists.txt b/src/extension/plugins/grid2/CMakeLists.txt index f39e259de..eb200e96e 100644 --- a/src/extension/plugins/grid2/CMakeLists.txt +++ b/src/extension/plugins/grid2/CMakeLists.txt @@ -2,7 +2,7 @@ set(grid_PART_SRCS grid.cpp) include_directories( ${CMAKE_BINARY_DIR}/src ) -add_library(grid2 SHARED ${grid_PART_SRCS}) +add_library(grid2 SHARED EXCLUDE_FROM_ALL ${grid_PART_SRCS}) target_link_libraries(grid2 inkscape_base) -- cgit v1.2.3