Fix CMAKE_POSITION_INDEPENDENT_CODE
Description
This PR just fixed a wrong configuration in the cmake files with the POSITION_INDEPENDENT_CODE, it should be just enabled when the ENABLE_SHARED_LIB
config is enabled as well.
In my case, I'm trying to compile the library for the Playstation Portable platform (PSP
)
Otherwise, we're suffering issues as:
[ 6%] Generating symbolic link bzcmp of bzdiff
[ 13%] Building C object CMakeFiles/bz2_ObjLib.dir/blocksort.c.obj
cc1: error: cannot generate position-independent code for ‘-mabi=eabi’
make[2]: *** [CMakeFiles/bz2_ObjLib.dir/build.make:76: CMakeFiles/bz2_ObjLib.dir/blocksort.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:131: CMakeFiles/bz2_ObjLib.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:146: all] Error 2
Thanks