Compare commits

...

23 Commits

Author SHA1 Message Date
e-erdal
896ab5478c Add __cplusplus for MSVC 2022-06-24 11:42:25 +03:00
loanselot
23a1dc204a Merge pull request #135 from bkaradzic/dependabot/submodules/bx-6332fb0
build(deps): bump bx from `8832707` to `6332fb0`
2022-06-24 11:36:57 +03:00
loanselot
5fa58aad11 Merge pull request #136 from bkaradzic/dependabot/submodules/bgfx-9204a53
build(deps): bump bgfx from `379fc70` to `9204a53`
2022-06-24 11:36:49 +03:00
dependabot[bot]
8dafd0d9e4 build(deps): bump bgfx from 379fc70 to 9204a53
Bumps [bgfx](https://github.com/bkaradzic/bgfx) from `379fc70` to `9204a53`.
- [Release notes](https://github.com/bkaradzic/bgfx/releases)
- [Commits](379fc707ff...9204a536dd)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-01 16:03:24 +00:00
dependabot[bot]
3bac602264 build(deps): bump bx from 8832707 to 6332fb0
Bumps [bx](https://github.com/bkaradzic/bx) from `8832707` to `6332fb0`.
- [Release notes](https://github.com/bkaradzic/bx/releases)
- [Commits](88327070b9...6332fb0305)

---
updated-dependencies:
- dependency-name: bx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-01 16:03:20 +00:00
loanselot
1b2b921bde Merge pull request #134 from bkaradzic/dependabot/submodules/bgfx-379fc70
build(deps): bump bgfx from `5ae2271` to `379fc70`
2022-05-04 12:26:41 +03:00
loanselot
374dcbba70 Merge pull request #133 from bkaradzic/dependabot/submodules/bx-8832707
build(deps): bump bx from `ad018d4` to `8832707`
2022-05-04 12:26:26 +03:00
dependabot[bot]
95af1cc54d build(deps): bump bgfx from 5ae2271 to 379fc70
Bumps [bgfx](https://github.com/bkaradzic/bgfx) from `5ae2271` to `379fc70`.
- [Release notes](https://github.com/bkaradzic/bgfx/releases)
- [Commits](5ae2271667...379fc707ff)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-01 16:01:28 +00:00
dependabot[bot]
e85f8c0f3c build(deps): bump bx from ad018d4 to 8832707
Bumps [bx](https://github.com/bkaradzic/bx) from `ad018d4` to `8832707`.
- [Release notes](https://github.com/bkaradzic/bx/releases)
- [Commits](ad018d47c6...88327070b9)

---
updated-dependencies:
- dependency-name: bx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-01 16:01:26 +00:00
loanselot
9ecbe9ee51 Merge pull request #131 from bkaradzic/dependabot/submodules/bgfx-5ae2271
Bump bgfx from `ae7aeba` to `5ae2271`
2022-04-12 02:24:53 +03:00
Sandy Carter
d725e78f86 bgfx: Add BGFX_MULTITHREADED option 2022-04-10 22:30:07 -04:00
dependabot[bot]
93de01a1af Bump bgfx from ae7aeba to 5ae2271
Bumps [bgfx](https://github.com/bkaradzic/bgfx) from `ae7aeba` to `5ae2271`.
- [Release notes](https://github.com/bkaradzic/bgfx/releases)
- [Commits](ae7aeba72c...5ae2271667)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-01 16:02:10 +00:00
Sandy Carter
dd2017c332 examples: Don't build on android by default 2022-03-30 17:09:46 -04:00
Sandy Carter
ead887f59b bx: Link with android log library 2022-03-30 17:09:46 -04:00
Sandy Carter
f184835827 glsl-optimizer: set libraries as STATIC explicitly 2022-03-30 17:09:31 -04:00
Tom Hulton-Harrop
a7ac0aa3ae add additional space around parens 2022-03-21 20:52:06 -04:00
Tom Hulton-Harrop
163661a07e update to have bgfx.cmake work with emscripten 2022-03-21 20:52:06 -04:00
loanselot
99b9c1e852 Merge pull request #126 from bkaradzic/dependabot/submodules/bx-ad018d4
Bump bx from `c969169` to `ad018d4`
2022-03-08 13:51:21 +03:00
loanselot
28ea11be6d Merge pull request #125 from bkaradzic/dependabot/submodules/bimg-663f724
Bump bimg from `9d6af16` to `663f724`
2022-03-08 13:51:14 +03:00
loanselot
0006784f70 Merge pull request #124 from bkaradzic/dependabot/submodules/bgfx-ae7aeba
Bump bgfx from `e79f92a` to `ae7aeba`
2022-03-08 13:51:07 +03:00
dependabot[bot]
819719a4f9 Bump bx from c969169 to ad018d4
Bumps [bx](https://github.com/bkaradzic/bx) from `c969169` to `ad018d4`.
- [Release notes](https://github.com/bkaradzic/bx/releases)
- [Commits](c969169fc1...ad018d47c6)

---
updated-dependencies:
- dependency-name: bx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 16:02:16 +00:00
dependabot[bot]
5b34c97f4c Bump bimg from 9d6af16 to 663f724
Bumps [bimg](https://github.com/bkaradzic/bimg) from `9d6af16` to `663f724`.
- [Release notes](https://github.com/bkaradzic/bimg/releases)
- [Commits](9d6af16116...663f724186)

---
updated-dependencies:
- dependency-name: bimg
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 16:02:13 +00:00
dependabot[bot]
4846036666 Bump bgfx from e79f92a to ae7aeba
Bumps [bgfx](https://github.com/bkaradzic/bgfx) from `e79f92a` to `ae7aeba`.
- [Release notes](https://github.com/bkaradzic/bgfx/releases)
- [Commits](e79f92a241...ae7aeba72c)

---
updated-dependencies:
- dependency-name: bgfx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 16:02:11 +00:00
10 changed files with 44 additions and 22 deletions

View File

@@ -21,14 +21,19 @@ if( APPLE AND NOT XCODE )
set( CMAKE_CXX_FLAGS "-ObjC++" )
endif()
option( BGFX_BUILD_TOOLS "Build bgfx tools." ON )
option( BGFX_BUILD_EXAMPLES "Build bgfx examples." ON )
option( BGFX_INSTALL "Create installation target." ON )
option( BGFX_INSTALL_EXAMPLES "Install examples and their runtimes." OFF )
option( BGFX_CUSTOM_TARGETS "Include convenience custom targets." ON )
option( BGFX_AMALGAMATED "Amalgamated bgfx build for faster compilation" OFF )
option( BX_AMALGAMATED "Amalgamated bx build for faster compilation" OFF )
option( BGFX_CONFIG_RENDERER_WEBGPU "Enables the webgpu renderer" OFF )
if (MSVC AND (MSVC_VERSION GREATER_EQUAL 1914))
add_compile_options("/Zc:__cplusplus")
endif()
option( BGFX_BUILD_TOOLS "Build bgfx tools." ON )
option( BGFX_BUILD_EXAMPLES "Build bgfx examples." ON )
option( BGFX_INSTALL "Create installation target." ON )
option( BGFX_INSTALL_EXAMPLES "Install examples and their runtimes." OFF )
option( BGFX_CUSTOM_TARGETS "Include convenience custom targets." ON )
option( BGFX_AMALGAMATED "Amalgamated bgfx build for faster compilation" OFF )
option( BX_AMALGAMATED "Amalgamated bx build for faster compilation" OFF )
option( BGFX_CONFIG_MULTITHREADED "Build bgfx with multithreaded configuration" ON )
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" )

2
bgfx

Submodule bgfx updated: e79f92a241...9204a536dd

2
bimg

Submodule bimg updated: 9d6af16116...663f724186

2
bx

Submodule bx updated: c969169fc1...6332fb0305

View File

@@ -27,7 +27,8 @@ string(REPLACE "-fsanitize=undefined" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
# glcpp
file( GLOB GLCPP_SOURCES ${BGFX_DIR}/3rdparty/glsl-optimizer/src/glsl/glcpp/*.c ${BGFX_DIR}/3rdparty/glsl-optimizer/src/util/*.c )
add_library( glcpp ${GLCPP_SOURCES} )
# Library must be static because hash_table_ctor referenced in function glcpp_parser_create
add_library( glcpp STATIC ${GLCPP_SOURCES} )
target_include_directories( glcpp PUBLIC ${GLSL-OPTIMIZER_INCLUDES} )
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
target_compile_options( glcpp PRIVATE "-fno-strict-aliasing")
@@ -39,7 +40,8 @@ set_target_properties( glcpp PROPERTIES FOLDER "bgfx/3rdparty" )
# mesa
file( GLOB MESA_SOURCES ${BGFX_DIR}/3rdparty/glsl-optimizer/src/mesa/program/*.c ${BGFX_DIR}/3rdparty/glsl-optimizer/src/mesa/main/*.c )
add_library( mesa ${MESA_SOURCES} )
# Library must be static because mesa/program/prog_hash_table.c uses _mesa_error_no_memory which is in glsl/standalone_scaffolding.cpp of glsl-optimizer
add_library( mesa STATIC ${MESA_SOURCES} )
target_include_directories( mesa PUBLIC ${GLSL-OPTIMIZER_INCLUDES} )
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
target_compile_options( mesa PRIVATE "-fno-strict-aliasing")
@@ -53,7 +55,7 @@ set_target_properties( mesa PROPERTIES FOLDER "bgfx/3rdparty" )
file( GLOB GLSL-OPTIMIZER_SOURCES ${BGFX_DIR}/3rdparty/glsl-optimizer/src/glsl/*.cpp ${BGFX_DIR}/3rdparty/glsl-optimizer/src/glsl/*.c )
file( GLOB GLSL-OPTIMIZER_SOURCES_REMOVE ${BGFX_DIR}/3rdparty/glsl-optimizer/src/glsl/main.cpp ${BGFX_DIR}/3rdparty/glsl-optimizer/src/glsl/builtin_stubs.cpp )
list( REMOVE_ITEM GLSL-OPTIMIZER_SOURCES ${GLSL-OPTIMIZER_SOURCES_REMOVE} )
add_library( glsl-optimizer ${GLSL-OPTIMIZER_SOURCES} )
add_library( glsl-optimizer STATIC ${GLSL-OPTIMIZER_SOURCES} )
target_link_libraries( glsl-optimizer glcpp mesa )
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options( glsl-optimizer

View File

@@ -70,7 +70,11 @@ if( MSVC )
endif()
# Add debug config required in bx headers since bx is private
target_compile_definitions(bgfx PUBLIC "BX_CONFIG_DEBUG=$<CONFIG:Debug>")
target_compile_definitions(bgfx
PUBLIC
"BX_CONFIG_DEBUG=$<CONFIG:Debug>"
"BGFX_CONFIG_MULTITHREADED=$<BOOL:${BGFX_CONFIG_MULTITHREADED}>"
)
# Includes
target_include_directories( bgfx

View File

@@ -70,17 +70,22 @@ target_compile_definitions( bx PUBLIC "__STDC_CONSTANT_MACROS" )
target_compile_definitions(bx PUBLIC "BX_CONFIG_DEBUG=$<CONFIG:Debug>")
# Additional dependencies on Unix
if( UNIX AND NOT APPLE AND NOT ANDROID )
if (ANDROID)
# For __android_log_write
find_library( LOG_LIBRARY log )
mark_as_advanced( LOG_LIBRARY )
target_link_libraries( bx PUBLIC ${LOG_LIBRARY} )
elseif( APPLE )
find_library( FOUNDATION_LIBRARY Foundation)
mark_as_advanced( FOUNDATION_LIBRARY )
target_link_libraries( bx PUBLIC ${FOUNDATION_LIBRARY} )
elseif( UNIX )
# Threads
find_package( Threads )
target_link_libraries( bx ${CMAKE_THREAD_LIBS_INIT} dl )
# Real time (for clock_gettime)
target_link_libraries( bx rt )
elseif(APPLE)
find_library( FOUNDATION_LIBRARY Foundation)
mark_as_advanced( FOUNDATION_LIBRARY )
target_link_libraries( bx PUBLIC ${FOUNDATION_LIBRARY} )
endif()
# Put in a "bgfx" folder in Visual Studio

View File

@@ -171,7 +171,7 @@ function( add_example ARG_NAME )
target_compile_definitions( example-${ARG_NAME} PRIVATE "-D_CRT_SECURE_NO_WARNINGS" "-D__STDC_FORMAT_MACROS" "-DENTRY_CONFIG_IMPLEMENT_MAIN=1" )
# Configure shaders
if( NOT ARG_COMMON AND NOT IOS AND NOT EMSCRIPTEN)
if( NOT ARG_COMMON AND NOT IOS AND NOT EMSCRIPTEN AND NOT ANDROID)
foreach( SHADER ${SHADERS} )
add_bgfx_shader( ${SHADER} ${ARG_NAME} )
endforeach()

View File

@@ -11,6 +11,9 @@
add_executable( geometryv ${BGFX_DIR}/tools/geometryv/geometryv.cpp )
set_target_properties( geometryv PROPERTIES FOLDER "bgfx/tools" )
target_link_libraries( geometryv example-common )
if(EMSCRIPTEN)
target_link_options( geometryv PRIVATE -sMAX_WEBGL_VERSION=2 )
endif()
if( BGFX_CUSTOM_TARGETS )
add_dependencies( tools geometryv )
endif()

View File

@@ -13,6 +13,9 @@ include( CMakeParseArguments )
add_executable( texturev ${BGFX_DIR}/tools/texturev/texturev.cpp )
set_target_properties( texturev PROPERTIES FOLDER "bgfx/tools" )
target_link_libraries( texturev example-common )
if (EMSCRIPTEN)
target_link_options( texturev PRIVATE -sMAX_WEBGL_VERSION=2 )
endif()
if( BGFX_CUSTOM_TARGETS )
add_dependencies( tools texturev )
endif()
@@ -20,4 +23,4 @@ endif()
if (IOS)
set_target_properties(texturev PROPERTIES MACOSX_BUNDLE ON
MACOSX_BUNDLE_GUI_IDENTIFIER texturev)
endif()
endif()