PIC error compiling ACE with Clang

2019-04-16 15:27发布

问题:

I'm tring to compile some ACE lib within my project with PCH support and including only sources that i need

I'm on ubuntu 16.04 and i need to use clang

but i've this error:

error: PIC level differs in PCH file vs. current file

I've prepared a MVCE, you need clang installed ofc, then just run following commands:

git clone https://github.com/Yehonal/ace-clang-test.git
cd ace-clang-test
mkdir build
cd build
cmake -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CC_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ ..
make -j 4

How can i solve it?

EDIT: in repository linked above i've only created CMakeLists.txt and PCHSupport.cmake files, others are original sources from ACE lib