summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-10-16 02:31:22 +0000
committerGuy Harris <guy@alum.mit.edu>2015-10-16 02:31:27 +0000
commitb84b0315d3e917b7ab294f36cfc7a24e9c2d3cd0 (patch)
tree495b24fc539a2f9c56cc078230d107247e965bd0
parent1a94667cc3a22337efd17ab9d17898e53b4cba75 (diff)
downloadwireshark-b84b0315d3e917b7ab294f36cfc7a24e9c2d3cd0.tar.gz
Revert "Remove -fPIC with more than just MSVC."
This reverts commit 222de975c487977eafce9c6706da2221b6aa2f68. I realized how to do it with a compile test. Change-Id: I9468c50777e387c572f60411ca39ea86ba6ce520 Reviewed-on: https://code.wireshark.org/review/11078 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--CMakeLists.txt39
1 files changed, 2 insertions, 37 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2f0a61fb3d..85d77b73cf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -872,46 +872,11 @@ if(HAVE_LIBZLIB)
include_directories(BEFORE ${ZLIB_INCLUDE_DIRS})
endif()
if (Qt5Widgets_FOUND)
- #
# Qt5CoreConfigExtras.cmake in Qt 5.5.0 sets -fPIC unconditionally.
# https://bugreports.qt.io/browse/QTBUG-47942
- #
- # This *should* be done the same way we do it for autotools, by
- # checking whether we can compile a simple file that with just
- # "#include <QtCore>", and whatever else is necessary to let it
- # make it through check_cxx_source_compiles(), but doing that
- # is a bit of a pain - we'd need to somehow arrange that
- # the right include flags get passed to a compile done by
- # CMake rather than done in a Makefile or whatever generated
- # *by* CMake.
- #
- # So, for now, based on our knowledge that the "you have to build
- # everything with -fPIC" test only happens on systems using ELF
- # (which rules out Windows, OS X, AIX, 32-bit HP-UX, Tru64 UNIX,
- # and IRIX) with systems that claim to be GCC 5.0 or later, we
- # remove -fPIC for other systems. Checking for 32-bit HP-UX is
- # tricky, so we don't do it, and we hope that checking for
- # "Tru64" and "OSF1" handles that OS under all three of its
- # names (DEC OSF/1, Digital UNIX, Tru64 UNIX). It's also
- # some work to check the GCC version, so we don't do it for
- # now.
- #
- # Ultimately, we want *Qt* to fix the bug above. Our goal is
- # to suppress as many complaints that come from unnecessary
- # use of -fPIC, whether it's compiles failing because that
- # option is there or just Clang annoyingly whining that
- # -fPIC is being ignored.
- #
- if(CMAKE_CXX_PLATFORM_ID MATCHES "Cygwin" OR
- CMAKE_CXX_PLATFORM_ID MATCHES "MinGW" OR
- CMAKE_CXX_PLATFORM_ID MATCHES "Darwin"
- CMAKE_CXX_PLATFORM_ID MATCHES "Windows"
- CMAKE_CXX_PLATFORM_ID MATCHES "AIX"
- CMAKE_CXX_PLATFORM_ID MATCHES "IRIX"
- CMAKE_CXX_PLATFORM_ID MATCHES "Tru64"
- CMAKE_CXX_PLATFORM_ID MATCHES "OSF1")
+ if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
list(REMOVE_ITEM Qt5Widgets_EXECUTABLE_COMPILE_FLAGS "-fPIC")
- endif()
+ endif() # MSVC
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}")
set (QT_FOUND ON)
set (QT_LIBRARIES ${Qt5Widgets_LIBRARIES} ${Qt5PrintSupport_LIBRARIES})