- FreeBSD compile fix

This commit is contained in:
Rachael Alexanderson 2018-02-10 07:55:53 -05:00
parent 7cbe8669b6
commit 5dd98669e4
1 changed files with 6 additions and 0 deletions

View File

@ -391,6 +391,12 @@ if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE )
set( CMAKE_CXX_FLAGS "-Wno-unknown-pragmas -Wno-comment -Wno-format ${CMAKE_CXX_FLAGS}" )
endif()
# Detect FreeBSD and add flags
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC" )
endif()
if( NOT NO_STRIP )
set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s" )
set (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} -s" )