Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
cmake: turn on CMAKE_POSITION_INDEPENDENT_CODE for shared
Browse files Browse the repository at this point in the history
This prevents an error while linking libbx.a into libbgfx.so on linux
  • Loading branch information
bwrsandman committed Jan 31, 2021
1 parent 66f18da commit db7e9cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ set( BGFX_LIBRARY_TYPE "STATIC" CACHE STRING "Linking type for library" )

set_property( CACHE BGFX_LIBRARY_TYPE PROPERTY STRINGS STATIC SHARED )

if( BGFX_LIBRARY_TYPE MATCHES "SHARED" )
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()

if( NOT BX_DIR )
set( BX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bx" CACHE STRING "Location of bx." )
elseif( NOT IS_ABSOLUTE "${BX_DIR}")
Expand Down

0 comments on commit db7e9cb

Please sign in to comment.