From 81c4dc124891a07b2d4047dd60ed749b4c7b42f2 Mon Sep 17 00:00:00 2001 From: Antonin Portelli Date: Sat, 10 Feb 2024 18:51:32 +0100 Subject: [PATCH] cmake format and PIC --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d3665cd..a4ebbdd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,8 @@ if(COMPILER_SUPPORTS_MTUNE_NATIVE) set(MTUNE_FLAG "-mtune=native") endif() set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG ${MARCH_FLAG} ${MTUNE_FLAG}") -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG ${MARCH_FLAG} ${MTUNE_FLAG}") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO + "-O3 -g -DNDEBUG ${MARCH_FLAG} ${MTUNE_FLAG}") set(gcc_like_cxx "$") add_library(compiler_flags INTERFACE) target_compile_features(compiler_flags INTERFACE cxx_std_14) @@ -33,6 +34,9 @@ target_compile_options( compiler_flags INTERFACE "$<${gcc_like_cxx}:-Wall;-Wextra;-Wshadow;-Wformat=2;-Wunused>") +# position idependent code +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + # installation rpath setup set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")