Add option to build bgfx as shared lib (#79)

Closes #21
This commit is contained in:
Sandy
2020-06-11 12:19:41 +02:00
committed by GitHub
parent dbf05e9e9b
commit 22ffa2e003
2 changed files with 7 additions and 3 deletions

View File

@@ -34,8 +34,12 @@ option( BGFX_AMALGAMATED "Amalgamated bgfx build for faster compilation" OF
option( BX_AMALGAMATED "Amalgamated bx build for faster compilation" OFF )
option( BGFX_CONFIG_DEBUG "Enables debug configuration on all builds" OFF )
option( BGFX_CONFIG_RENDERER_WEBGPU "Enables the webgpu renderer" OFF )
set( BGFX_OPENGL_VERSION "" CACHE STRING "Specify minimum OpenGL version" )
set( BGFX_OPENGLES_VERSION "" CACHE STRING "Specify minimum OpenGL ES version" )
set( BGFX_OPENGL_VERSION "" CACHE STRING "Specify minimum opengl version" )
set( BGFX_OPENGLES_VERSION "" CACHE STRING "Specify minimum OpenGL ES version" )
set( BGFX_LIBRARY_TYPE "STATIC" CACHE STRING "Linking type for library" )
set_property( CACHE BGFX_LIBRARY_TYPE PROPERTY STRINGS STATIC SHARED )
if( NOT BX_DIR )
set( BX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bx" CACHE STRING "Location of bx." )

View File

@@ -40,7 +40,7 @@ else()
endif()
# Create the bgfx target
add_library( bgfx ${BGFX_SOURCES} )
add_library( bgfx ${BGFX_LIBRARY_TYPE} ${BGFX_SOURCES} )
if(BGFX_CONFIG_RENDERER_WEBGPU)
include(cmake/3rdparty/webgpu.cmake)