From 662cbbe65794dc7a9ec925df86241a3ca5810afd Mon Sep 17 00:00:00 2001 From: Dawid Drozd Date: Thu, 25 Aug 2016 02:50:12 +0200 Subject: [PATCH] Fix BUILD_SHARED_LIBS ON needs -fPIC #16426 (#16427) Fix for issue #16426 --- cmake/Modules/SetCompilerOptions.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/Modules/SetCompilerOptions.cmake b/cmake/Modules/SetCompilerOptions.cmake index 54c59d1c82..a3548ab080 100644 --- a/cmake/Modules/SetCompilerOptions.cmake +++ b/cmake/Modules/SetCompilerOptions.cmake @@ -52,8 +52,8 @@ macro (SetCompilerOptions) else() set(CMAKE_C_FLAGS_DEBUG "-g -Wall -Wextra") set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG}) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-deprecated-declarations -Wno-reorder") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -fPIC") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-deprecated-declarations -Wno-reorder -fPIC") if(CLANG) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") endif()