Skip to content

Commit 9f645c6

Browse files
committedNov 13, 2018
cmake option for forcing static libs
1 parent 79b4b48 commit 9f645c6

File tree

7 files changed

+24
-31
lines changed

7 files changed

+24
-31
lines changed
 

‎CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,20 @@ IF(NOT MSVC)
6969
endif(USE_CCACHE)
7070
endif(NOT MSVC)
7171

72+
IF (IOS)
73+
SET (DEFAULT_FORCE_STATIC_LIBS TRUE)
74+
ELSE (IOS)
75+
SET (DEFAULT_FORCE_STATIC_LIBS FALSE)
76+
ENDIF (IOS)
77+
SET (FORCE_STATIC_LIBS ${DEFAULT_FORCE_STATIC_LIBS} CACHE BOOL "Determines whether libraries should be static only")
78+
MARK_AS_ADVANCED(FORCE_STATIC_LIBS)
79+
80+
IF(FORCE_STATIC_LIBS)
81+
SET(LIBRARY_TYPE STATIC)
82+
ELSE (FORCE_STATIC_LIBS)
83+
SET(LIBRARY_TYPE SHARED)
84+
ENDIF (FORCE_STATIC_LIBS)
85+
7286
# in generated makefiles use relative paths so the project dir is moveable
7387
# Note commented out since it cause problems but it would be nice to resolve these and enable
7488
#

‎src/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
IF (NOT IOS)
2-
ADD_SUBDIRECTORY(native)
3-
ENDIF (NOT IOS)
4-
1+
ADD_SUBDIRECTORY(native)
52
ADD_SUBDIRECTORY(core)
63

74
IF (NOT IOS)

‎src/core/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,14 +1271,8 @@ ADD_DEFINITIONS(-DTEST_DATA_DIR="${TEST_DATA_DIR}")
12711271

12721272
#############################################################
12731273
# qgis_core library
1274-
IF (IOS)
1275-
SET(LIBRARY_TYPE STATIC)
1276-
ELSE (IOS)
1277-
SET(LIBRARY_TYPE SHARED)
1278-
ENDIF (IOS)
12791274
ADD_LIBRARY(qgis_core ${LIBRARY_TYPE} ${QGIS_CORE_SRCS} ${QGIS_CORE_MOC_SRCS} ${QGIS_CORE_HDRS} ${QGIS_CORE_MOC_HDRS})
12801275

1281-
12821276
GENERATE_EXPORT_HEADER(
12831277
qgis_core
12841278
BASE_NAME CORE

‎src/core/qgsmaprenderertask.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,9 @@ class CORE_EXPORT QgsMapRendererTask : public QgsTask
4646
//! \brief Error type
4747
enum ErrorType
4848
{
49-
//! Image allocation failure
50-
ImageAllocationFail = 1,
51-
//! Image save failure
52-
ImageSaveFail,
53-
54-
/**
55-
* Format is unsupported on the platform
56-
* \since QGIS 3.4
57-
*/
58-
ImageUnsupportedFormat
49+
ImageAllocationFail = 1, //!< Image allocation failure
50+
ImageSaveFail, //!< Image save failure
51+
ImageUnsupportedFormat //!< Format is unsupported on the platform \since QGIS 3.4
5952
};
6053

6154
/**

‎src/native/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#############################################################
22
# locate native libs
33

4+
IF (IOS)
5+
# No native library for IOS
6+
RETURN()
7+
ENDIF(IOS)
8+
9+
410
SET(NATIVE_LINK_LIBS)
511

612
IF(UNIX AND NOT APPLE AND NOT ANDROID)

‎src/quickgui/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,6 @@ ELSE(MSVC)
9999
SET_SOURCE_FILES_PROPERTIES(${QGIS_QUICK_GUI_MOC_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations" )
100100
ENDIF(MSVC)
101101

102-
IF (IOS)
103-
SET(LIBRARY_TYPE STATIC)
104-
ELSE (IOS)
105-
SET(LIBRARY_TYPE SHARED)
106-
ENDIF (IOS)
107102
ADD_LIBRARY(qgis_quick ${LIBRARY_TYPE}
108103
${QGIS_QUICK_GUI_IMAGE_RCC_SRCS}
109104
${QGIS_QUICK_GUI_SRC}

‎src/quickgui/plugin/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ ELSE (IOS)
3030
SET(QGIS_QUICK_PLUGIN_RESOURCES ${QGIS_QUICK_PLUGIN_RESOURCES} qmldir)
3131
ENDIF (IOS)
3232

33-
3433
INCLUDE_DIRECTORIES(
3534
${CMAKE_CURRENT_SOURCE_DIR}
3635
${CMAKE_CURRENT_BINARY_DIR}
@@ -85,11 +84,6 @@ ENDIF(MSVC)
8584

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

88-
IF (IOS)
89-
SET(LIBRARY_TYPE STATIC)
90-
ELSE (IOS)
91-
SET(LIBRARY_TYPE MODULE)
92-
ENDIF (IOS)
9387
ADD_LIBRARY(qgis_quick_plugin ${LIBRARY_TYPE}
9488
${QGIS_QUICK_PLUGIN_SRC}
9589
${QGIS_QUICK_PLUGIN_MOC_HDRS}

0 commit comments

Comments
 (0)
Please sign in to comment.