Skip to content

Commit

Permalink
cmake option for forcing static libs
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik committed Nov 13, 2018
1 parent 79b4b48 commit 9f645c6
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 31 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Expand Up @@ -69,6 +69,20 @@ IF(NOT MSVC)
endif(USE_CCACHE)
endif(NOT MSVC)

IF (IOS)
SET (DEFAULT_FORCE_STATIC_LIBS TRUE)
ELSE (IOS)
SET (DEFAULT_FORCE_STATIC_LIBS FALSE)
ENDIF (IOS)
SET (FORCE_STATIC_LIBS ${DEFAULT_FORCE_STATIC_LIBS} CACHE BOOL "Determines whether libraries should be static only")
MARK_AS_ADVANCED(FORCE_STATIC_LIBS)

IF(FORCE_STATIC_LIBS)
SET(LIBRARY_TYPE STATIC)
ELSE (FORCE_STATIC_LIBS)
SET(LIBRARY_TYPE SHARED)
ENDIF (FORCE_STATIC_LIBS)

# in generated makefiles use relative paths so the project dir is moveable
# Note commented out since it cause problems but it would be nice to resolve these and enable
#
Expand Down
5 changes: 1 addition & 4 deletions src/CMakeLists.txt
@@ -1,7 +1,4 @@
IF (NOT IOS)
ADD_SUBDIRECTORY(native)
ENDIF (NOT IOS)

ADD_SUBDIRECTORY(native)
ADD_SUBDIRECTORY(core)

IF (NOT IOS)
Expand Down
6 changes: 0 additions & 6 deletions src/core/CMakeLists.txt
Expand Up @@ -1271,14 +1271,8 @@ ADD_DEFINITIONS(-DTEST_DATA_DIR="${TEST_DATA_DIR}")

#############################################################
# qgis_core library
IF (IOS)
SET(LIBRARY_TYPE STATIC)
ELSE (IOS)
SET(LIBRARY_TYPE SHARED)
ENDIF (IOS)
ADD_LIBRARY(qgis_core ${LIBRARY_TYPE} ${QGIS_CORE_SRCS} ${QGIS_CORE_MOC_SRCS} ${QGIS_CORE_HDRS} ${QGIS_CORE_MOC_HDRS})


GENERATE_EXPORT_HEADER(
qgis_core
BASE_NAME CORE
Expand Down
13 changes: 3 additions & 10 deletions src/core/qgsmaprenderertask.h
Expand Up @@ -46,16 +46,9 @@ class CORE_EXPORT QgsMapRendererTask : public QgsTask
//! \brief Error type
enum ErrorType
{
//! Image allocation failure
ImageAllocationFail = 1,
//! Image save failure
ImageSaveFail,

/**
* Format is unsupported on the platform
* \since QGIS 3.4
*/
ImageUnsupportedFormat
ImageAllocationFail = 1, //!< Image allocation failure
ImageSaveFail, //!< Image save failure
ImageUnsupportedFormat //!< Format is unsupported on the platform \since QGIS 3.4
};

/**
Expand Down
6 changes: 6 additions & 0 deletions src/native/CMakeLists.txt
@@ -1,6 +1,12 @@
#############################################################
# locate native libs

IF (IOS)
# No native library for IOS
RETURN()
ENDIF(IOS)


SET(NATIVE_LINK_LIBS)

IF(UNIX AND NOT APPLE AND NOT ANDROID)
Expand Down
5 changes: 0 additions & 5 deletions src/quickgui/CMakeLists.txt
Expand Up @@ -99,11 +99,6 @@ ELSE(MSVC)
SET_SOURCE_FILES_PROPERTIES(${QGIS_QUICK_GUI_MOC_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations" )
ENDIF(MSVC)

IF (IOS)
SET(LIBRARY_TYPE STATIC)
ELSE (IOS)
SET(LIBRARY_TYPE SHARED)
ENDIF (IOS)
ADD_LIBRARY(qgis_quick ${LIBRARY_TYPE}
${QGIS_QUICK_GUI_IMAGE_RCC_SRCS}
${QGIS_QUICK_GUI_SRC}
Expand Down
6 changes: 0 additions & 6 deletions src/quickgui/plugin/CMakeLists.txt
Expand Up @@ -30,7 +30,6 @@ ELSE (IOS)
SET(QGIS_QUICK_PLUGIN_RESOURCES ${QGIS_QUICK_PLUGIN_RESOURCES} qmldir)
ENDIF (IOS)


INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
Expand Down Expand Up @@ -85,11 +84,6 @@ ENDIF(MSVC)

SET(QGIS_QUICK_PLUGIN_RUNTIME_DIR ${QGIS_OUTPUT_DIRECTORY}/${QGIS_QML_SUBDIR}/QgsQuick)

IF (IOS)
SET(LIBRARY_TYPE STATIC)
ELSE (IOS)
SET(LIBRARY_TYPE MODULE)
ENDIF (IOS)
ADD_LIBRARY(qgis_quick_plugin ${LIBRARY_TYPE}
${QGIS_QUICK_PLUGIN_SRC}
${QGIS_QUICK_PLUGIN_MOC_HDRS}
Expand Down

0 comments on commit 9f645c6

Please sign in to comment.