Skip to content
Permalink
Browse files

Simpler handling of DLL_EXPORT defines

  • Loading branch information
m-kuhn committed Jun 11, 2016
1 parent bd75fec commit d3fd81845a971d14f6bde1128e53d7dc456f1bb8
@@ -612,6 +612,7 @@ ENDIF (ANDROID)
IF(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
cmake_policy(SET CMP0005 OLD)
cmake_policy(SET CMP0063 NEW)
ENDIF(COMMAND cmake_policy)

IF (WIN32)
@@ -640,6 +641,8 @@ ADD_DEFINITIONS("-DAPP_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DCUSTOMWIDGETS_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DSERVER_EXPORT=${DLLIMPORT}")

SET(CMAKE_CXX_VISIBILITY_PRESET hidden)

#############################################################
# user-changeable settings which can be used to customize
# layout of QGIS installation
@@ -149,12 +149,7 @@ INCLUDE_DIRECTORIES(SYSTEM
${SQLITE3_INCLUDE_DIR}
)

IF (NOT MSVC)
ADD_DEFINITIONS("-UANALYSIS_EXPORT")
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
ENDIF()
ENDIF (NOT MSVC)
REMOVE_DEFINITIONS("-DANALYSIS_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("\"-DANALYSIS_EXPORT=${DLLEXPORT}\"")

#############################################################
@@ -584,12 +584,7 @@ ELSE (ANDROID)
ADD_EXECUTABLE(${QGIS_APP_NAME} MACOSX_BUNDLE WIN32 ${QGIS_APPMAIN_SRCS} ${IMAGE_RCC_SRCS} ${TEST_RCC_SRCS})
ENDIF (ANDROID)

IF (NOT MSVC)
ADD_DEFINITIONS("-UAPP_EXPORT")
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
ENDIF()
ENDIF (NOT MSVC)
REMOVE_DEFINITIONS("-DAPP_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("\"-DAPP_EXPORT=${DLLEXPORT}\"")

# Putting IMAGE_RCC_SRCS into qgis_app lib is cousing problems when the lib is loaded (by plugin for example) in test unit (qgis_composerpicturetest).
@@ -877,12 +877,7 @@ INCLUDE_DIRECTORIES(SYSTEM
${QCA_INCLUDE_DIR}
)

IF (NOT MSVC)
ADD_DEFINITIONS("-UCORE_EXPORT")
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
ENDIF()
ENDIF (NOT MSVC)
REMOVE_DEFINITIONS("-DCORE_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("\"-DCORE_EXPORT=${DLLEXPORT}\"")


@@ -10,12 +10,7 @@ ENDIF (QT5_BUILD)
SET(QT_USE_QTDESIGNER ON)


IF (NOT MSVC)
ADD_DEFINITIONS("-UCUSTOMWIDGETS_EXPORT")
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
ENDIF()
ENDIF (NOT MSVC)
REMOVE_DEFINITIONS("-DCUSTOMWIDGETS_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("\"-DCUSTOMWIDGETS_EXPORT=${DLLEXPORT}\"")

########################################################
@@ -758,12 +758,7 @@ INCLUDE_DIRECTORIES(SYSTEM
${GDAL_INCLUDE_DIR}
)

IF (NOT MSVC)
ADD_DEFINITIONS("-UGUI_EXPORT")
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
ENDIF()
ENDIF (NOT MSVC)
REMOVE_DEFINITIONS("-DGUI_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("\"-DGUI_EXPORT=${DLLEXPORT}\"")

# disable deprecation warnings for classes re-exporting deprecated methods
@@ -1,9 +1,4 @@
IF (NOT MSVC)
ADD_DEFINITIONS("-UPYTHON_EXPORT")
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
ENDIF()
ENDIF (NOT MSVC)
REMOVE_DEFINITIONS("-DPYTHON_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("\"-DPYTHON_EXPORT=${DLLEXPORT}\"")

SET(QGISPYTHON_SRCS qgispython.cpp qgspythonutilsimpl.cpp)
@@ -100,12 +100,7 @@ SET(qgis_mapserv_SRCS ${qgis_mapserv_SRCS}
)
ENDIF (WITH_SERVER_PLUGINS)

IF (NOT MSVC)
ADD_DEFINITIONS("-USERVER_EXPORT")
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
ENDIF()
ENDIF (NOT MSVC)
REMOVE_DEFINITIONS("-DSERVER_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("\"-DSERVER_EXPORT=${DLLEXPORT}\"")


5 comments on commit d3fd818

@m-kuhn

This comment has been minimized.

Copy link
Member Author

@m-kuhn m-kuhn replied Jun 11, 2016

If this breaks Windows builds, feel free to revert

CC @jef-n @NathanW2

@jef-n

This comment has been minimized.

Copy link
Member

@jef-n jef-n replied Jun 11, 2016

not sure about windows - but it does break builds on trusty, wily and jessie

@m-kuhn

This comment has been minimized.

Copy link
Member Author

@m-kuhn m-kuhn replied Jun 11, 2016

also with the followup commits?

@jef-n

This comment has been minimized.

Copy link
Member

@jef-n jef-n replied Jun 11, 2016

with 1877bcd:
CMake Error at CMakeLists.txt:615 (cmake_policy): Policy "CMP0063" is not known to this version of CMake.
trusty has CMake 2.8.12.2

@m-kuhn

This comment has been minimized.

Copy link
Member Author

@m-kuhn m-kuhn replied Jun 11, 2016

I don't know this policy stuff good enough... If it's set to old, does it also complain? I just inserted the statement to shut up the warning, I don't think it makes a difference for us.

Please sign in to comment.
You can’t perform that action at this time.