Compile with -fPIC so we can build shared libdcp with static openjp2.
authorCarl Hetherington <cth@carlh.net>
Fri, 1 Sep 2017 23:22:41 +0000 (19:22 -0400)
committercah <cah@ableton.com>
Tue, 3 Dec 2019 10:36:05 +0000 (11:36 +0100)
CMakeLists.txt

index 70554ad1b892b1896c06b81089c41c0c6205457a..234d53452c154bc3ddbf2f01f1214e6b4c5eaea5 100644 (file)
@@ -193,7 +193,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
   # For all builds, make sure openjpeg is std99 compliant:
   # set(CMAKE_C_FLAGS "-Wall -std=c99 ${CMAKE_C_FLAGS}") # FIXME: this setting prevented us from setting a coverage build.
   # Do not use ffast-math for all build, it would produce incorrect results, only set for release:
-  set(OPENJPEG_LIBRARY_COMPILE_OPTIONS ${OPENJPEG_LIBRARY_COMPILE_OPTIONS} "$<$<CONFIG:Release>:-ffast-math>")
+  SET(OPENJPEG_LIBRARY_COMPILE_OPTIONS ${OPENJPEG_LIBRARY_COMPILE_OPTIONS} "$<$<CONFIG:Release>:-ffast-math>" "-fPIC")
   set(OPENJP2_COMPILE_OPTIONS ${OPENJP2_COMPILE_OPTIONS} "$<$<CONFIG:Release>:-ffast-math>" -Wall -Wextra -Wconversion -Wunused-parameter -Wdeclaration-after-statement -Werror=declaration-after-statement)
 endif()