mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-10 01:09:50 +00:00
Fixed: Don't use -fPIC and -fPIE together (this could occur in some cases)
This commit is contained in:
parent
6d10e3189c
commit
3e4a567d6a
1 changed files with 6 additions and 7 deletions
|
@ -38,17 +38,16 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
|
|||
STRING(TOUPPER "${CMAKE_BUILD_TYPE}" _UPPER_BUILD)
|
||||
LIST(APPEND _FLAGS " ${CMAKE_CXX_FLAGS_${_UPPER_BUILD}}")
|
||||
|
||||
IF(NOT MSVC)
|
||||
GET_TARGET_PROPERTY(_targetType ${_target} TYPE)
|
||||
IF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
|
||||
LIST(APPEND _FLAGS " -fPIC")
|
||||
ENDIF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
|
||||
GET_TARGET_PROPERTY(_targetType ${_target} TYPE)
|
||||
|
||||
IF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
|
||||
LIST(APPEND _FLAGS " ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}")
|
||||
ELSE(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
|
||||
GET_TARGET_PROPERTY(_pic ${_target} POSITION_INDEPENDENT_CODE)
|
||||
IF(_pic)
|
||||
LIST(APPEND _FLAGS " -fPIE")
|
||||
LIST(APPEND _FLAGS " ${CMAKE_CXX_COMPILE_OPTIONS_PIE}")
|
||||
ENDIF(_pic)
|
||||
ENDIF(NOT MSVC)
|
||||
ENDIF(${_targetType} STREQUAL SHARED_LIBRARY OR ${_targetType} STREQUAL MODULE_LIBRARY)
|
||||
|
||||
GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES)
|
||||
FOREACH(item ${DIRINC})
|
||||
|
|
Loading…
Reference in a new issue