mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-10 06:51:54 +00:00
CMakeLists.txt: make positional code (-fPIC) customizible. (#616)
For some use cases it is necessary to specify -fPIC even if we build static library e.g. building vst plugins (*.so) which may not load shared libraries from outside the system paths (depends on DAWs). For such environment we would like to build the final shared library without depending on `libfluidsynth.so(.*)` but if we build libfluidsynth.a it always comes without -fPIC. This change makes it adjustable.
This commit is contained in:
parent
a250ac2a97
commit
69ba49348a
1 changed files with 3 additions and 1 deletions
|
@ -121,7 +121,9 @@ set(CMAKE_C_STANDARD 90)
|
|||
# Compile with position independent code if the user requested a shared lib, i.e. no PIC if static requested.
|
||||
# This is cmakes default behavior, but here it's explicitly required due to the use of libfluidsynth-OBJ as object library,
|
||||
# which would otherwise always be compiled without PIC.
|
||||
set ( CMAKE_POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS} )
|
||||
if ( NOT CMAKE_POSITION_INDEPENDENT_CODE )
|
||||
set ( CMAKE_POSITION_INDEPENDENT_CODE ${BUILD_SHARED_LIBS} )
|
||||
endif ( CMAKE_POSITION_INDEPENDENT_CODE )
|
||||
|
||||
# the default global visibility level for all target
|
||||
# no visibility support on OS2
|
||||
|
|
Loading…
Reference in a new issue