From 7b23be0c46a07d1005325effdc80dcf605ad465b Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 18 Jul 2018 10:40:36 +0200 Subject: [PATCH 1/3] Fixed: Compilation under Linux with Qt 5.10 --HG-- branch : develop --- code/CMakeLists.txt | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 425f296f5..159c63ef2 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -312,12 +312,19 @@ IF(WITH_QT5) ADD_QT_PLUGIN(xcbglintegrations qxcb-glx-integration) ADD_QT_LIBRARY(XcbQpa) + ADD_QT_LIBRARY(GlxSupport) + ADD_QT_LIBRARY(ServiceSupport) + ADD_QT_LIBRARY(EdidSupport) + ADD_QT_LIBRARY(FontDatabaseSupport) + ADD_QT_LIBRARY(ThemeSupport) + ADD_QT_LIBRARY(EventDispatcherSupport) ADD_QT_LIBRARY(PlatformSupport) - SET(QT_LIBRARIES ${QT_LIBRARIES} -lX11-xcb -lXi -lSM -lICE -lxcb -lGL -lxcb-glx) + + SET(QT_LIBRARIES ${QT_LIBRARIES} -lX11-xcb -lSM -lICE -lxcb -lGL -lxcb-glx) IF(EXISTS "${QT_LIBRARY_DIR}/libxcb-static.a") SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_LIBRARY_DIR}/libxcb-static.a") ENDIF() - SET(QT_LIBRARIES ${QT_LIBRARIES} -lfontconfig) + SET(QT_LIBRARIES ${QT_LIBRARIES} -lfontconfig -lX11 -lXrender) ADD_QT_LIBRARY(DBus) ENDIF() @@ -329,6 +336,9 @@ IF(WITH_QT5) # harfbuzz is needed since Qt 5.3 IF(UNIX) SET(HB_LIB "${QT_LIBRARY_DIR}/libqtharfbuzzng.a") + IF(NOT EXISTS ${HB_LIB}) + SET(HB_LIB "${QT_LIBRARY_DIR}/libqtharfbuzz.a") + ENDIF() ELSEIF(WIN32) SET(HB_LIB "${QT_LIBRARY_DIR}/qtharfbuzzng.lib") ENDIF() @@ -373,6 +383,9 @@ IF(WITH_QT5) # pcre is needed since Qt 5.5 IF(UNIX) SET(PCRE_LIB "${QT_LIBRARY_DIR}/libqtpcre.a") + IF(NOT EXISTS ${PCRE_LIB}) + SET(PCRE_LIB "${QT_LIBRARY_DIR}/libqtpcre2.a") + ENDIF() ELSEIF(WIN32) SET(PCRE_LIB "${QT_LIBRARY_DIR}/qtpcre.lib") ENDIF() @@ -391,7 +404,7 @@ IF(WITH_QT5) ${CARBON_FRAMEWORK} ${SECURITY_FRAMEWORK}) ELSEIF(UNIX) - SET(QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} -ldl -lrt) + SET(QT_LIBRARIES ${QT_LIBRARIES} ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} -ldl -lrt) ENDIF() ELSE() SET(QT_LIBRARIES Qt5::Widgets Qt5::Network Qt5::Xml Qt5::Gui Qt5::OpenGL Qt5::Core) From 728c602bc384c30de15a4fcd78db33e95aa46c28 Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 18 Jul 2018 10:41:11 +0200 Subject: [PATCH 2/3] Fixed: Compilation under Ubuntu 16.04 --HG-- branch : develop --- code/CMakeModules/nel.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 99d958771..3919419be 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -672,7 +672,7 @@ MACRO(NL_SETUP_BUILD) IF(APPLE) SET(OBJC_FLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch -fobjc-weak) - + IF(NOT XCODE) IF(CMAKE_OSX_ARCHITECTURES) SET(TARGETS_COUNT 0) @@ -959,8 +959,6 @@ MACRO(NL_SETUP_BUILD) ADD_PLATFORM_FLAGS("-fPIC") ENDIF() - SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} -ftemplate-depth-48") - # hardening ADD_PLATFORM_FLAGS("-fstack-protector --param=ssp-buffer-size=4") From 41d2b26d1a904c5589a5753c3f6d791a4e78c12c Mon Sep 17 00:00:00 2001 From: kervala Date: Wed, 18 Jul 2018 22:17:04 +0200 Subject: [PATCH 3/3] Changed: Link dynamically to existing system libs only --HG-- branch : develop --- code/CMakeLists.txt | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 159c63ef2..df71410fb 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -227,6 +227,28 @@ MACRO(ADD_QT_PLUGIN _TYPE _NAME) ENDIF() ENDMACRO() +MACRO(ADD_QT_SYSTEM_LIBRARY _NAME) + # Save default suffixes + SET(_OLD_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) + + # Define specific suffixes + SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX}) + + # Find the library with specified suffixes + FIND_LIBRARY(${_NAME}_LIBRARY NAMES ${_NAME}) + + # Restore default suffixes + SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_OLD_SUFFIXES}) + + IF(${_NAME}_LIBRARY) + MESSAGE(STATUS "Found ${${_NAME}_LIBRARY} ${_NAME}") + + LIST(APPEND QT_LIBRARIES ${${_NAME}_LIBRARY}) + ELSE() + MESSAGE(STATUS "Didn't find ${_NAME}") + ENDIF() +ENDMACRO() + IF(WITH_QT5) CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR) @@ -320,12 +342,24 @@ IF(WITH_QT5) ADD_QT_LIBRARY(EventDispatcherSupport) ADD_QT_LIBRARY(PlatformSupport) - SET(QT_LIBRARIES ${QT_LIBRARIES} -lX11-xcb -lSM -lICE -lxcb -lGL -lxcb-glx) + ADD_QT_LIBRARY(DBus) + IF(EXISTS "${QT_LIBRARY_DIR}/libxcb-static.a") SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_LIBRARY_DIR}/libxcb-static.a") ENDIF() - SET(QT_LIBRARIES ${QT_LIBRARIES} -lfontconfig -lX11 -lXrender) - ADD_QT_LIBRARY(DBus) + + # always link these in dynamic, API never changes + ADD_QT_SYSTEM_LIBRARY(X11) + ADD_QT_SYSTEM_LIBRARY(Xmu) + ADD_QT_SYSTEM_LIBRARY(X11-xcb) + ADD_QT_SYSTEM_LIBRARY(Xi) + ADD_QT_SYSTEM_LIBRARY(SM) + ADD_QT_SYSTEM_LIBRARY(ICE) + ADD_QT_SYSTEM_LIBRARY(xcb) + ADD_QT_SYSTEM_LIBRARY(GL) + ADD_QT_SYSTEM_LIBRARY(xcb-glx) + ADD_QT_SYSTEM_LIBRARY(fontconfig) + ADD_QT_SYSTEM_LIBRARY(Xrender) ENDIF() ADD_QT_PLUGIN(imageformats qgif)