Compare commits

...

47 Commits

Author SHA1 Message Date
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]
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
loanselot
3168a4660e Merge pull request #103 from Ravbug/bx_debug_fix
BX_CONFIG_DEBUG via generator expression
2022-02-03 13:05:49 +03:00
Ravbug
b5879646bb Incorporate MrRobust's suggestion 2022-02-02 16:30:21 -05:00
loanselot
9426a2f44f Update dependabot.yml 2022-02-02 15:44:32 +03:00
loanselot
3cf48b42d1 Merge pull request #122 from bkaradzic/dependabot/submodules/bgfx-e79f92a
Bump bgfx from `9f04292` to `e79f92a`
2022-02-02 15:42:15 +03:00
dependabot[bot]
b5192910f9 Bump bgfx from 9f04292 to e79f92a
Bumps [bgfx](https://github.com/bkaradzic/bgfx) from `9f04292` to `e79f92a`.
- [Release notes](https://github.com/bkaradzic/bgfx/releases)
- [Commits](9f04292f40...e79f92a241)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-01 16:13:45 +00:00
loanselot
b44793b740 Merge pull request #114 from recisio/cmake_include_paths
CMake more precise includes path
2022-01-31 21:26:30 +03:00
loanselot
1b74840891 Merge pull request #120 from bkaradzic/dependabot/submodules/bgfx-9f04292
Bump bgfx from `cd2030c` to `9f04292`
2022-01-31 20:56:20 +03:00
dependabot[bot]
b193a31651 Bump bgfx from cd2030c to 9f04292
Bumps [bgfx](https://github.com/bkaradzic/bgfx) from `cd2030c` to `9f04292`.
- [Release notes](https://github.com/bkaradzic/bgfx/releases)
- [Commits](cd2030cc11...9f04292f40)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 17:16:26 +00:00
loanselot
146a9f43b0 Merge pull request #121 from bkaradzic/ci-fix-2
Add IOKit for Metal backend
2022-01-31 20:15:14 +03:00
e-erdal
9f3943b829 Link IOKit + CoreFoundation 2022-01-31 19:38:44 +03:00
e-erdal
f81d8ee146 Add IOKit for Metal backend 2022-01-31 19:16:08 +03:00
e-erdal
d65bbd523e Merge branches 'dependabot/submodules/bimg-9d6af16', 'dependabot/submodules/bgfx-cd2030c' and 'dependabot/submodules/bx-c969169' of https://github.com/bkaradzic/bgfx.cmake 2022-01-31 18:44:22 +03:00
dependabot[bot]
d3449c2f68 Bump bimg from 9e4d2b1 to 9d6af16
Bumps [bimg](https://github.com/bkaradzic/bimg) from `9e4d2b1` to `9d6af16`.
- [Release notes](https://github.com/bkaradzic/bimg/releases)
- [Commits](9e4d2b167f...9d6af16116)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-17 16:14:11 +00:00
dependabot[bot]
0745f23a13 Bump bgfx from 932d2f2 to cd2030c
Bumps [bgfx](https://github.com/bkaradzic/bgfx) from `932d2f2` to `cd2030c`.
- [Release notes](https://github.com/bkaradzic/bgfx/releases)
- [Commits](932d2f21e7...cd2030cc11)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-17 16:14:10 +00:00
dependabot[bot]
0424ae3763 Bump bx from 51c3264 to c969169
Bumps [bx](https://github.com/bkaradzic/bx) from `51c3264` to `c969169`.
- [Release notes](https://github.com/bkaradzic/bx/releases)
- [Commits](51c3264846...c969169fc1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-17 16:14:07 +00:00
alexandrebeaudet
72bc1cf167 CMake more precise includes path (in order to use some functions externally) 2022-01-07 10:57:18 +01:00
Sandy Carter
7e7a6795a1 Use string compare for library type 2021-12-23 13:52:18 -05:00
Ravbug
93c9e73a42 Add checked & profile 2021-12-19 12:12:00 -08:00
Ravbug
0f1a5a91e6 Change BGFX_CONFIG_DEBUG to generator expression 2021-12-19 11:44:52 -08:00
Sandy Carter
a01e8e043f bgfx: Add debug config required in bx headers since bx is private 2021-10-30 10:14:58 -04:00
loanselot
5205429de2 Merge pull request #79 from bkaradzic/ci-fix
Add definition type
2021-10-28 12:00:14 +03:00
e-erdal
25f2107994 Add definition type 2021-10-28 11:16:14 +03:00
loanselot
75b9076904 Merge pull request #78 from bkaradzic/dependabot/submodules/bgfx-932d2f2
Bump bgfx from `6573fc4` to `932d2f2`
2021-10-28 11:06:55 +03:00
loanselot
de4c88ac51 Merge pull request #76 from bkaradzic/dependabot/submodules/bimg-9e4d2b1
Bump bimg from `6693de0` to `9e4d2b1`
2021-10-28 11:06:48 +03:00
loanselot
d575656458 Merge pull request #75 from bkaradzic/dependabot/submodules/bx-51c3264
Bump bx from `11c3c5e` to `51c3264`
2021-10-28 11:06:41 +03:00
e-erdal
d3260f172c Add definition for BX_CONFIG_DEBUG 2021-10-28 11:06:14 +03:00
dependabot[bot]
f290d91828 Bump bgfx from 6573fc4 to 932d2f2
Bumps [bgfx](https://github.com/bkaradzic/bgfx) from `6573fc4` to `932d2f2`.
- [Release notes](https://github.com/bkaradzic/bgfx/releases)
- [Commits](6573fc44a8...932d2f21e7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-27 16:12:45 +00:00
dependabot[bot]
23577764fe Bump bimg from 6693de0 to 9e4d2b1
Bumps [bimg](https://github.com/bkaradzic/bimg) from `6693de0` to `9e4d2b1`.
- [Release notes](https://github.com/bkaradzic/bimg/releases)
- [Commits](6693de0e50...9e4d2b167f)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-26 16:15:23 +00:00
dependabot[bot]
ec90e950f1 Bump bx from 11c3c5e to 51c3264
Bumps [bx](https://github.com/bkaradzic/bx) from `11c3c5e` to `51c3264`.
- [Release notes](https://github.com/bkaradzic/bx/releases)
- [Commits](11c3c5e615...51c3264846)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-26 16:15:21 +00:00
loanselot
8a301010d7 Merge pull request #73 from bkaradzic/dependabot/submodules/bx-11c3c5e
Bump bx from `f324ffa` to `11c3c5e`
2021-10-23 07:15:32 +03:00
dependabot[bot]
8a1d4fe3b1 Bump bx from f324ffa to 11c3c5e
Bumps [bx](https://github.com/bkaradzic/bx) from `f324ffa` to `11c3c5e`.
- [Release notes](https://github.com/bkaradzic/bx/releases)
- [Commits](f324ffad46...11c3c5e615)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-22 16:11:49 +00:00
17 changed files with 92 additions and 72 deletions

View File

@@ -3,4 +3,4 @@ updates:
- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "daily"
interval: "monthly"

View File

@@ -75,11 +75,10 @@ jobs:
# Run CMake to generate project files
- name: Generate project files
run: |
cmake -B "${{ env.CMAKE_BUILD_DIR }}" -DCMAKE_INSTALL_PREFIX="${{ env.CMAKE_INSTALL_DIR }}" -DCMAKE_DEBUG_POSTFIX=d -DBGFX_BUILD_EXAMPLES=OFF -DBGFX_BUILD_TOOLS=ON -DBGFX_INSTALL=ON -DBGFX_AMALGAMATED=ON
cmake -B "${{ env.CMAKE_BUILD_DIR }}" -DCMAKE_INSTALL_PREFIX="${{ env.CMAKE_INSTALL_DIR }}" -DCMAKE_DEBUG_POSTFIX=d -DBGFX_BUILD_EXAMPLES=OFF -DBGFX_BUILD_TOOLS=ON -DBGFX_INSTALL=ON -DBGFX_AMALGAMATED=ON -DCMAKE_BUILD_TYPE=Release
# Build the install targets
- name: Build
run: |
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target install --config Debug
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target install --config Release
- uses: actions/upload-artifact@v2
with:

1
.gitignore vendored
View File

@@ -13,3 +13,4 @@ install_manifest.txt
generated/*
!generated/*.in
cmake_install.cmake
.cache/

View File

@@ -21,15 +21,15 @@ 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_DEBUG "Enables debug configuration on all builds" OFF )
option( BGFX_CONFIG_RENDERER_WEBGPU "Enables the webgpu renderer" OFF )
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" )
@@ -58,19 +58,19 @@ elseif( NOT IS_ABSOLUTE "${BGFX_DIR}")
endif()
# sets project version from api ver / git rev
include( cmake/version.cmake )
include( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/version.cmake )
include( cmake/shared.cmake )
include( cmake/bx.cmake )
include( cmake/bimg.cmake )
include( cmake/bgfx.cmake )
include( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/shared.cmake )
include( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/bx.cmake )
include( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/bimg.cmake )
include( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/bgfx.cmake )
if( BGFX_BUILD_TOOLS )
include( cmake/tools.cmake )
include( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/tools.cmake )
endif()
if( BGFX_BUILD_TOOLS OR BGFX_BUILD_EXAMPLES )
include( cmake/examples.cmake )
include( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/examples.cmake )
endif()
if( BGFX_INSTALL )
@@ -111,7 +111,7 @@ if( BGFX_INSTALL )
# * TARGETS_EXPORT_NAME
# * PROJECT_NAME
configure_package_config_file(
"cmake/Config.cmake.in"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in"
"${project_config}"
INSTALL_DESTINATION "${config_install_dir}"
)

2
bgfx

Submodule bgfx updated: 6573fc44a8...5ae2271667

2
bimg

Submodule bimg updated: 6693de0e50...663f724186

2
bx

Submodule bx updated: f324ffad46...88327070b9

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

@@ -40,10 +40,14 @@ else()
endif()
# Create the bgfx target
add_library( bgfx ${BGFX_LIBRARY_TYPE} ${BGFX_SOURCES} )
if(BGFX_LIBRARY_TYPE STREQUAL STATIC)
add_library( bgfx STATIC ${BGFX_SOURCES} )
else()
add_library( bgfx SHARED ${BGFX_SOURCES} )
endif()
if(BGFX_CONFIG_RENDERER_WEBGPU)
include(cmake/3rdparty/webgpu.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/3rdparty/webgpu.cmake)
target_compile_definitions( bgfx PRIVATE BGFX_CONFIG_RENDERER_WEBGPU=1)
if (EMSCRIPTEN)
target_link_options(bgfx PRIVATE "-s USE_WEBGPU=1")
@@ -52,12 +56,6 @@ if(BGFX_CONFIG_RENDERER_WEBGPU)
endif()
endif()
# Enable BGFX_CONFIG_DEBUG in Debug configuration
target_compile_definitions( bgfx PRIVATE "$<$<CONFIG:Debug>:BGFX_CONFIG_DEBUG=1>" )
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_MIN_VERSION=${BGFX_OPENGL_VERSION} )
endif()
@@ -71,6 +69,13 @@ if( MSVC )
target_compile_definitions( bgfx PRIVATE "_CRT_SECURE_NO_WARNINGS" )
endif()
# Add debug config required in bx headers since bx is private
target_compile_definitions(bgfx
PUBLIC
"BX_CONFIG_DEBUG=$<CONFIG:Debug>"
"BGFX_CONFIG_MULTITHREADED=$<BOOL:${BGFX_CONFIG_MULTITHREADED}>"
)
# Includes
target_include_directories( bgfx
PRIVATE
@@ -86,15 +91,20 @@ target_link_libraries( bgfx PRIVATE bx bimg )
# Frameworks required on iOS, tvOS and macOS
if( ${CMAKE_SYSTEM_NAME} MATCHES iOS|tvOS )
target_link_libraries (bgfx PUBLIC "-framework OpenGLES -framework Metal -framework UIKit -framework CoreGraphics -framework QuartzCore")
target_link_libraries (bgfx PUBLIC
"-framework OpenGLES -framework Metal -framework UIKit -framework CoreGraphics -framework QuartzCore -framework IOKit -framework CoreFoundation")
elseif( APPLE )
find_library( COCOA_LIBRARY Cocoa )
find_library( METAL_LIBRARY Metal )
find_library( QUARTZCORE_LIBRARY QuartzCore )
find_library( IOKIT_LIBRARY IOKit )
find_library( COREFOUNDATION_LIBRARY CoreFoundation )
mark_as_advanced( COCOA_LIBRARY )
mark_as_advanced( METAL_LIBRARY )
mark_as_advanced( QUARTZCORE_LIBRARY )
target_link_libraries( bgfx PUBLIC ${COCOA_LIBRARY} ${METAL_LIBRARY} ${QUARTZCORE_LIBRARY} )
mark_as_advanced( IOKIT_LIBRARY )
mark_as_advanced( COREFOUNDATION_LIBRARY )
target_link_libraries( bgfx PUBLIC ${COCOA_LIBRARY} ${METAL_LIBRARY} ${QUARTZCORE_LIBRARY} ${IOKIT_LIBRARY} ${COREFOUNDATION_LIBRARY} )
endif()
if( UNIX AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ANDROID )

View File

@@ -9,16 +9,16 @@
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# Third party libs
include( cmake/3rdparty/astc-codec.cmake )
include( cmake/3rdparty/astc.cmake )
include( cmake/3rdparty/edtaa3.cmake )
include( cmake/3rdparty/etc1.cmake )
include( cmake/3rdparty/etc2.cmake )
include( cmake/3rdparty/iqa.cmake )
include( cmake/3rdparty/libsquish.cmake )
include( cmake/3rdparty/nvtt.cmake )
include( cmake/3rdparty/pvrtc.cmake )
include( cmake/3rdparty/tinyexr.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/astc-codec.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/astc.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/edtaa3.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/etc1.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/etc2.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/iqa.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/libsquish.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/nvtt.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/pvrtc.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/tinyexr.cmake )
# Ensure the directory exists
if( NOT IS_DIRECTORY ${BIMG_DIR} )

View File

@@ -67,23 +67,25 @@ target_compile_definitions( bx PUBLIC "__STDC_LIMIT_MACROS" )
target_compile_definitions( bx PUBLIC "__STDC_FORMAT_MACROS" )
target_compile_definitions( bx PUBLIC "__STDC_CONSTANT_MACROS" )
target_compile_definitions( bx PRIVATE "$<$<CONFIG:Debug>:BX_CONFIG_DEBUG=1>" )
if(BGFX_CONFIG_DEBUG)
target_compile_definitions( bx PRIVATE BX_CONFIG_DEBUG=1)
endif()
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

@@ -10,10 +10,10 @@
include( CMakeParseArguments )
include( cmake/util/ConfigureDebugging.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/util/ConfigureDebugging.cmake )
include( cmake/3rdparty/dear-imgui.cmake )
include( cmake/3rdparty/meshoptimizer.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/dear-imgui.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/meshoptimizer.cmake )
function( add_bgfx_shader FILE FOLDER )
get_filename_component( FILENAME "${FILE}" NAME_WE )
@@ -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

@@ -13,8 +13,8 @@ if( BGFX_CUSTOM_TARGETS )
set_target_properties( tools PROPERTIES FOLDER "bgfx/tools" )
endif()
include( cmake/tools/geometryc.cmake )
include( cmake/tools/geometryv.cmake )
include( cmake/tools/shaderc.cmake )
include( cmake/tools/texturec.cmake )
include( cmake/tools/texturev.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/tools/geometryc.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/tools/geometryv.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/tools/shaderc.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/tools/texturec.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/tools/texturev.cmake )

View File

@@ -10,7 +10,7 @@
include( CMakeParseArguments )
include( cmake/3rdparty/meshoptimizer.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/../3rdparty/meshoptimizer.cmake )
add_executable( geometryc ${BGFX_DIR}/tools/geometryc/geometryc.cpp )
target_compile_definitions( geometryc PRIVATE "-D_CRT_SECURE_NO_WARNINGS" )

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

@@ -10,12 +10,12 @@
include( CMakeParseArguments )
include( cmake/3rdparty/fcpp.cmake )
include( cmake/3rdparty/glsl-optimizer.cmake )
include( cmake/3rdparty/glslang.cmake )
include( cmake/3rdparty/spirv-cross.cmake )
include( cmake/3rdparty/spirv-tools.cmake )
include( cmake/3rdparty/webgpu.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/../3rdparty/fcpp.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/../3rdparty/glsl-optimizer.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/../3rdparty/glslang.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/../3rdparty/spirv-cross.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/../3rdparty/spirv-tools.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/../3rdparty/webgpu.cmake )
add_executable( shaderc ${BGFX_DIR}/tools/shaderc/shaderc.cpp ${BGFX_DIR}/tools/shaderc/shaderc.h ${BGFX_DIR}/tools/shaderc/shaderc_glsl.cpp ${BGFX_DIR}/tools/shaderc/shaderc_hlsl.cpp ${BGFX_DIR}/tools/shaderc/shaderc_pssl.cpp ${BGFX_DIR}/tools/shaderc/shaderc_spirv.cpp ${BGFX_DIR}/tools/shaderc/shaderc_metal.cpp )
target_compile_definitions( shaderc PRIVATE "-D_CRT_SECURE_NO_WARNINGS" )

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()