aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2019-09-17 19:07:54 +0100
committerGuy Harris <guy@alum.mit.edu>2019-09-19 18:51:27 +0000
commita5445705469d2daa152935c96860fcc7d3269b26 (patch)
tree081fce4b3bd6f1aa1c77a0abad5e821ea40f9d3e /CMakeLists.txt
parenta97c157d0d193e8b1bb04a65e556d0683546bec7 (diff)
Fix build with non-standard install prefix
The variables BUILD_dumpcap and PCAP_FOUND are defined after the if condition, therefore wireshark is built with a relative RPATH and library loading for privileged processes fails with glibc. Move the definition of BUILD_dumpcap before it is used and drop the test for PCAP_FOUND. Move a comment to the proper line while at it. Change-Id: Ie151a3781898e712f9e324e9ef995022bbea40b6 Reviewed-on: https://code.wireshark.org/review/34564 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 6 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 731b68dce2..d97f19424b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,6 +41,8 @@ set(PROJECT_VERSION "${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT
set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}")
+include( CMakeOptions.txt )
+
# We require minimum C++11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -199,11 +201,8 @@ if(NOT (WIN32 OR APPLE OR USE_STATIC))
# binaries. In other cases, only absolute paths can be used.
# https://www.lekensteyn.nl/rpath.html
if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|SunOS|FreeBSD)$")
- # Provide a knob to optionally force absolute rpaths,
- # to support old/buggy systems and as a user preference
- # for hardening.
set(_enable_rpath_origin TRUE)
- if(BUILD_dumpcap AND PCAP_FOUND)
+ if(BUILD_dumpcap)
# dumpcap will most likely be installed with
# capabilities or setuid. Relative RPATHs that
# resolve to non-standard library directories
@@ -212,6 +211,9 @@ if(NOT (WIN32 OR APPLE OR USE_STATIC))
# disable it by default.
set(_enable_rpath_origin FALSE)
endif()
+ # Provide a knob to optionally force absolute rpaths,
+ # to support old/buggy systems and as a user preference
+ # for hardening.
set(ENABLE_RPATH_ORIGIN ${_enable_rpath_origin} CACHE BOOL
"Use $ORIGIN with INSTALL_RPATH")
mark_as_advanced(ENABLE_RPATH_ORIGIN)
@@ -310,7 +312,6 @@ include_directories(
${CMAKE_SOURCE_DIR}
)
-include( CMakeOptions.txt )
if( DUMPCAP_INSTALL_OPTION STREQUAL "suid" )
set( DUMPCAP_SETUID "SETUID" )
else()