From ba931c1b4a23ca769feae37acda763fa2260da5c Mon Sep 17 00:00:00 2001 From: Baruch Sterin Date: Thu, 5 Nov 2015 01:23:32 -0800 Subject: [PATCH] CMakeLists.txt: add a new target libabc-pic, a library compiled with -fPIC, not complied by default --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c47da11a9..7d9479592 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,3 +56,10 @@ endfunction() add_executable(abc ${ABC_SRC}) abc_properties(abc PRIVATE) +list(REMOVE_ITEM ABC_SRC src/base/main/main.c) + +add_library(libabc-pic EXCLUDE_FROM_ALL ${ABC_SRC}) +abc_properties(libabc-pic PUBLIC) + +set_property(TARGET libabc-pic PROPERTY POSITION_INDEPENDENT_CODE ON) +set_property(TARGET libabc-pic PROPERTY OUTPUT_NAME abc-pic)