From 607170f769e77645a91ab21472b1d2c469185d60 Mon Sep 17 00:00:00 2001 From: zariiii9003 <52598363+zariiii9003@users.noreply.github.com> Date: Tue, 19 Nov 2024 17:32:01 +0100 Subject: [PATCH] Set flag for Position Independent Code to fix ubuntu compilation --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba1db61..af00839 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,10 @@ cmake_minimum_required(VERSION 3.15...3.26) project(${SKBUILD_PROJECT_NAME} LANGUAGES C) +if(NOT MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") +endif() + find_package(Python REQUIRED COMPONENTS