From b19d84216cc5f2486c80d952489583b0f10680be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= Date: Tue, 17 Oct 2023 22:56:54 +0100 Subject: [PATCH] cmake: build static libraries with position independent code (#1219) --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index afaa6c683a..b8a9b85986 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,6 +103,8 @@ option(PCAPPP_PACKAGE "Package Pcap++ could require a recent version of CMake" O set(CMAKE_CXX_STANDARD 11) # popen()/pclose() are not C++ standards set(CMAKE_CXX_EXTENSIONS ON) +# Set Position Independent Code for static libraries +set(CMAKE_POSITION_INDEPENDENT_CODE ON) # Usually on Windows PCAP_ROOT and Packet_ROOT are at the same location if(WIN32