Link with -fPIC when using Clang.

Remove the need for a few workarounds by handling this in just one place.
This commit is contained in:
leper
2019-01-09 00:55:19 +01:00
parent 7c68e09d77
commit 542711f862
4 changed files with 4 additions and 26 deletions

View File

@ -43,10 +43,12 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
IF(CMAKE_BUILD_TYPE STREQUAL "debug")
ADD_DEFINITIONS(-D_DEBUG)
ENDIF(CMAKE_BUILD_TYPE STREQUAL "debug")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
ENDIF()
IF(MSVC)
# @@ Some of these might only be available in VC8.
# Code generation flags.