[CMake] properly declare FPIC

use CMAKE_POSITION_INDEPENDENT_CODE instead of manually addinf -fPIC to CXX args.

	modified:   CMakeLists.txt
This commit is contained in:
Adrian Lucrèce Céleste 2019-08-23 15:40:36 -04:00
parent f1c570752b
commit 1bdc95a498
No known key found for this signature in database
GPG Key ID: 9107708A028D10D2

View File

@ -53,7 +53,7 @@ include_directories (BEFORE SYSTEM ./ext/gtest/include)
if (UNIX) if (UNIX)
if (NOT APPLE) if (NOT APPLE)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") set (CMAKE_POSITION_INDEPENDENT_CODE TRUE)
endif() endif()
# For config.h, detect the libraries, functions, etc. # For config.h, detect the libraries, functions, etc.