Fix position independent code on Linux. (#941)
This commit is contained in:
committed by
Alec Jacobson
parent
8a2d93cf14
commit
e21aa88a8b
@@ -87,6 +87,11 @@ if(BUILD_SHARED_LIBS)
|
||||
set_target_properties(igl_common PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
||||
endif()
|
||||
|
||||
# Eigen
|
||||
if(TARGET Eigen3::Eigen)
|
||||
# If an imported target already exists, use it
|
||||
|
||||
@@ -16,7 +16,7 @@ find_package(PythonLibs REQUIRED)
|
||||
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" U_CMAKE_BUILD_TYPE)
|
||||
if(UNIX)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
|
||||
if(NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -flto")
|
||||
|
||||
Reference in New Issue
Block a user