Build environment: Fix for C placement independent code
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 27 Aug 2018 13:45:18 +0000 (15:45 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 27 Aug 2018 13:48:39 +0000 (15:48 +0200)
Need to pass -fPIC to C code as well.
Without this blosc is not being properly placement independent.

build_files/build_environment/cmake/options.cmake

index 3e02d43ec9097a597f352dc205ac8f3f8f36c414..7bf971208ae5ab16794325f8d51b7dc43fe4a83d 100644 (file)
@@ -147,13 +147,13 @@ else()
        endif()
 
        if(WITH_OPTIMIZED_DEBUG)
-               set(BLENDER_CMAKE_C_FLAGS_DEBUG "-O2 -DNDEBUG")
+               set(BLENDER_CMAKE_C_FLAGS_DEBUG "-O2 -DNDEBUG ${PLATFORM_CFLAGS}")
        else()
-               set(BLENDER_CMAKE_C_FLAGS_DEBUG "-g")
+               set(BLENDER_CMAKE_C_FLAGS_DEBUG "-g ${PLATFORM_CFLAGS}")
        endif()
-       set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG")
-       set(BLENDER_CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
-       set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG")
+       set(BLENDER_CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG ${PLATFORM_CFLAGS}")
+       set(BLENDER_CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG ${PLATFORM_CFLAGS}")
+       set(BLENDER_CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG ${PLATFORM_CFLAGS}")
 
        if(WITH_OPTIMIZED_DEBUG)
                set(BLENDER_CMAKE_CXX_FLAGS_DEBUG "-O2 -DNDEBUG ${PLATFORM_CXXFLAGS}")