Option to specify minimum opengl version at compile time

This commit is contained in:
Julien Hamaide
2019-01-24 10:42:14 +01:00
committed by Joshua Brookover
parent 89bb89d400
commit aeff603539
2 changed files with 5 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ 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_USE_DEBUG_SUFFIX "Add 'd' suffix to debug output targets" ON )
set( BGFX_OPENGL_VERSION "" CACHE STRING "Specify minimum opengl version" )
if( NOT BX_DIR )
set( BX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bx" CACHE STRING "Location of bx." )

View File

@@ -43,6 +43,10 @@ if(BGFX_CONFIG_DEBUG)
target_compile_definitions( bgfx PRIVATE BGFX_CONFIG_DEBUG=1)
endif()
if( NOT ${BGFX_OPENGL_VERSION} STREQUAL "" )
target_compile_definitions( bgfx PRIVATE BGFX_CONFIG_RENDERER_OPENGL=${BGFX_OPENGL_VERSION})
endif()
# Special Visual Studio Flags
if( MSVC )
target_compile_definitions( bgfx PRIVATE "_CRT_SECURE_NO_WARNINGS" )