From 361ce4a22955490e13adbd40eb594808142169a6 Mon Sep 17 00:00:00 2001 From: Stefan Radomski Date: Wed, 24 May 2017 21:23:07 +0200 Subject: Fixed issue 138 --- CMakeLists.txt | 4 ++++ contrib/patches/picoc/CMakeLists.txt | 2 ++ 2 files changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8112d10..7906396 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,6 +25,10 @@ include("${CMAKE_MODULE_PATH}/USCXMLMacros.cmake") # use folders in the IDEs for the various targets set_property(GLOBAL PROPERTY USE_FOLDERS ON) +# compile with fPIC if required +# see https://stackoverflow.com/questions/38296756/what-is-the-idiomatic-way-in-cmake-to-add-the-fpic-compiler-option +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + # use rpath with MacOSX set(CMAKE_MACOSX_RPATH 1) diff --git a/contrib/patches/picoc/CMakeLists.txt b/contrib/patches/picoc/CMakeLists.txt index 76fe184..2792907 100644 --- a/contrib/patches/picoc/CMakeLists.txt +++ b/contrib/patches/picoc/CMakeLists.txt @@ -3,6 +3,8 @@ project(picoc) # include_directories(${PROJECT_SOURCE_DIR}/include) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + file(GLOB PICOC_FILES ${PROJECT_SOURCE_DIR}/*.h ${PROJECT_SOURCE_DIR}/*.c -- cgit v0.12