Compare commits

...

21 Commits

Author SHA1 Message Date
dependabot[bot]
c825dcf256 build(deps): bump bimg from 225dad7 to 85109d7
Bumps [bimg](https://github.com/bkaradzic/bimg) from `225dad7` to `85109d7`.
- [Release notes](https://github.com/bkaradzic/bimg/releases)
- [Commits](225dad7441...85109d7cdb)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-02 17:35:38 -05:00
loanselot
916f26e1b6 Merge pull request #160 from Hyreos/patch-1
Prevent the script from trying to install tools that have been disabled
2022-11-28 16:18:22 +03:00
Hyreos
4e42ae2ae0 Prevent the script from trying to install tools that have been disabled
This commit fixes the issue of install failing if you disable any of the tools due to missing targets.
2022-11-20 17:23:21 -03:00
Johannes Schäufele
52feec47f5 bgfx: Add bgfx limits config options 2022-11-04 17:30:48 -04:00
loanselot
cf77d7c6d7 Merge pull request #159 from bkaradzic/dependabot/submodules/bgfx-6a03a1e
build(deps): bump bgfx from `f6a1289` to `6a03a1e`
2022-11-02 00:48:54 +03:00
loanselot
33dde1a115 Merge pull request #158 from bkaradzic/dependabot/submodules/bimg-225dad7
build(deps): bump bimg from `1955d8f` to `225dad7`
2022-11-02 00:48:44 +03:00
dependabot[bot]
3e7f1fe200 build(deps): bump bgfx from f6a1289 to 6a03a1e
Bumps [bgfx](https://github.com/bkaradzic/bgfx) from `f6a1289` to `6a03a1e`.
- [Release notes](https://github.com/bkaradzic/bgfx/releases)
- [Commits](f6a1289dbc...6a03a1ec5e)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-01 16:03:17 +00:00
dependabot[bot]
866599edb0 build(deps): bump bimg from 1955d8f to 225dad7
Bumps [bimg](https://github.com/bkaradzic/bimg) from `1955d8f` to `225dad7`.
- [Release notes](https://github.com/bkaradzic/bimg/releases)
- [Commits](1955d8f99a...225dad7441)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-01 16:03:13 +00:00
loanselot
089b388ac0 Merge pull request #156 from bkaradzic/temp
Update Submodules
2022-10-28 23:00:25 +03:00
e-erdal
9d3bc4f326 Update bgfx submodule 2022-10-28 22:21:19 +03:00
e-erdal
9ee85d3c1b Fix directx-headers 2022-10-28 21:48:50 +03:00
e-erdal
74a8e4dc72 ordering matters 2022-10-28 21:35:02 +03:00
e-erdal
99f17108ca Add linux compat for bx 2022-10-28 21:25:03 +03:00
e-erdal
862912e7e9 Fix WSL Include 2022-10-28 21:18:47 +03:00
e-erdal
72ea9b6f29 Add other DX Headers 2022-10-28 21:00:43 +03:00
e-erdal
6e23a39de6 Update submodules 2022-10-28 20:36:16 +03:00
loanselot
74e4a3fad9 Merge pull request #151 from SamHellawell/master
Allow to specify which tools to compile
2022-10-28 20:08:06 +03:00
Samuel Hellawell
5c54e5f299 Allow to specify which tools to compile
Signed-off-by: Samuel Hellawell <sshellawell@gmail.com>
2022-09-23 04:36:01 +01:00
Sandy Carter
06b995080d update submodules to dbafa14, 90ac47d, 8e94c8c 2022-08-26 10:29:01 -04:00
Sandy Carter
f5dc53db85 Find shaderc when cross-compiling 2022-08-24 11:56:03 -04:00
Sandy Carter
2051444e25 Install bgfxToolUtils even if not building tools
Fixes corner case of cross compiling with tools from host platform
2022-08-24 11:56:03 -04:00
11 changed files with 134 additions and 61 deletions

View File

@@ -26,6 +26,9 @@ if (MSVC AND (MSVC_VERSION GREATER_EQUAL 1914))
endif()
option( BGFX_BUILD_TOOLS "Build bgfx tools." ON )
option( BGFX_BUILD_TOOLS_SHADER "Build bgfx shader tools." ON )
option( BGFX_BUILD_TOOLS_GEOMETRY "Build bgfx geometry tools." ON )
option( BGFX_BUILD_TOOLS_TEXTURE "Build bgfx texture 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 )
@@ -40,6 +43,20 @@ 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( BGFX_CONFIG_DEFAULT_MAX_ENCODERS "" CACHE STRING "Specify default maximum encoder count (multithreaded only)" )
set( BGFX_CONFIG_MAX_DRAW_CALLS "" CACHE STRING "Specify maximum draw calls" )
set( BGFX_CONFIG_MAX_VIEWS "" CACHE STRING "Specify maximum view count (should be a power of two)" )
set( BGFX_CONFIG_MAX_FRAME_BUFFERS "" CACHE STRING "Specify maximum frame buffers" )
set( BGFX_CONFIG_MAX_VERTEX_LAYOUTS "" CACHE STRING "Specify maximum vertex layouts" )
set( BGFX_CONFIG_MAX_VERTEX_BUFFERS "" CACHE STRING "Specify maximum vertex buffer count" )
set( BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS "" CACHE STRING "Specify maximum dynamic vertex buffer count" )
set( BGFX_CONFIG_MAX_INDEX_BUFFERS "" CACHE STRING "Specify maximum index buffer count" )
set( BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS "" CACHE STRING "Specify maximum dynamic index buffer count" )
set( BGFX_CONFIG_MAX_TEXTURES "" CACHE STRING "Specify maximum texture count" )
set( BGFX_CONFIG_MAX_TEXTURE_SAMPLERS "" CACHE STRING "Specify maximum texture samplers" )
set( BGFX_CONFIG_MAX_SHADERS "" CACHE STRING "Specify shader count" )
set( BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM "" CACHE STRING "Specify maximum program count as 2^(program bits)" )
set_property( CACHE BGFX_LIBRARY_TYPE PROPERTY STRINGS STATIC SHARED )
if( BGFX_LIBRARY_TYPE MATCHES "SHARED" )
@@ -131,7 +148,7 @@ if( BGFX_INSTALL )
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
)
if( NOT BGFX_LIBRARY_TYPE MATCHES "SHARED" )
install( TARGETS bimg bx astc-codec astc edtaa3 etc1 etc2 iqa squish nvtt pvrtc tinyexr
install( TARGETS bimg bx astc-encoder edtaa3 etc1 etc2 iqa squish nvtt pvrtc tinyexr
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
@@ -160,24 +177,30 @@ if( BGFX_INSTALL )
)
# install tools
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/bgfxToolUtils.cmake
DESTINATION "${config_install_dir}")
if( BGFX_BUILD_TOOLS )
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/bgfxToolUtils.cmake
DESTINATION "${config_install_dir}")
install( TARGETS shaderc
EXPORT "${TARGETS_EXPORT_NAME}"
DESTINATION "${CMAKE_INSTALL_BINDIR}" )
install( TARGETS geometryc
EXPORT "${TARGETS_EXPORT_NAME}"
DESTINATION "${CMAKE_INSTALL_BINDIR}" )
install( TARGETS geometryv
EXPORT "${TARGETS_EXPORT_NAME}"
DESTINATION "${CMAKE_INSTALL_BINDIR}" )
install( TARGETS texturec
EXPORT "${TARGETS_EXPORT_NAME}"
DESTINATION "${CMAKE_INSTALL_BINDIR}" )
install( TARGETS texturev
EXPORT "${TARGETS_EXPORT_NAME}"
DESTINATION "${CMAKE_INSTALL_BINDIR}" )
if (BGFX_BUILD_TOOLS_SHADER)
install( TARGETS shaderc
EXPORT "${TARGETS_EXPORT_NAME}"
DESTINATION "${CMAKE_INSTALL_BINDIR}" )
endif()
if (BGFX_BUILD_TOOLS_GEOMETRY)
install( TARGETS geometryc
EXPORT "${TARGETS_EXPORT_NAME}"
DESTINATION "${CMAKE_INSTALL_BINDIR}" )
install( TARGETS geometryv
EXPORT "${TARGETS_EXPORT_NAME}"
DESTINATION "${CMAKE_INSTALL_BINDIR}" )
endif()
if (BGFX_BUILD_TOOLS_TEXTURE)
install( TARGETS texturec
EXPORT "${TARGETS_EXPORT_NAME}"
DESTINATION "${CMAKE_INSTALL_BINDIR}" )
install( TARGETS texturev
EXPORT "${TARGETS_EXPORT_NAME}"
DESTINATION "${CMAKE_INSTALL_BINDIR}" )
endif()
endif()
# install examples

2
bgfx

Submodule bgfx updated: 7cc56a01de...6a03a1ec5e

2
bimg

Submodule bimg updated: 663f724186...85109d7cdb

2
bx

Submodule bx updated: 6322a5159d...20efa22f18

View File

@@ -8,21 +8,21 @@
# You should have received a copy of the CC0 Public Domain Dedication along with
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
if( TARGET astc-codec )
if( TARGET astc-encoder )
return()
endif()
file(
GLOB
ASTC_CODEC_SOURCES
${BIMG_DIR}/3rdparty/astc-codec/src/decoder/*.cc
${BIMG_DIR}/3rdparty/astc-codec/src/decoder/*.h
ASTC_ENCODER_SOURCES
${BIMG_DIR}/3rdparty/astc-encoder/source/*.cpp
${BIMG_DIR}/3rdparty/astc-encoder/include/*.h
)
add_library( astc-codec STATIC ${ASTC_CODEC_SOURCES} )
target_include_directories( astc-codec
add_library( astc-encoder STATIC ${ASTC_ENCODER_SOURCES} )
target_include_directories( astc-encoder
PUBLIC
$<BUILD_INTERFACE:${BIMG_DIR}/3rdparty>
$<BUILD_INTERFACE:${BIMG_DIR}/3rdparty/astc-codec>
$<BUILD_INTERFACE:${BIMG_DIR}/3rdparty/astc-codec/include> )
set_target_properties( astc-codec PROPERTIES FOLDER "bgfx/3rdparty" )
$<BUILD_INTERFACE:${BIMG_DIR}/3rdparty/astc-encoder>
$<BUILD_INTERFACE:${BIMG_DIR}/3rdparty/astc-encoder/include> )
set_target_properties( astc-encoder PROPERTIES FOLDER "bgfx/3rdparty" )

View File

@@ -1,19 +0,0 @@
# bgfx.cmake - bgfx building in cmake
# Written in 2017 by Joshua Brookover <joshua.al.brookover@gmail.com>
# To the extent possible under law, the author(s) have dedicated all copyright
# and related and neighboring rights to this software to the public domain
# worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along with
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
if( TARGET astc )
return()
endif()
file( GLOB ASTC_SOURCES ${BIMG_DIR}/3rdparty/astc/*.cpp ${BIMG_DIR}/3rdparty/astc/*.h )
add_library( astc STATIC ${ASTC_SOURCES} )
target_include_directories( astc PUBLIC $<BUILD_INTERFACE:${BIMG_DIR}/3rdparty> )
set_target_properties( astc PROPERTIES FOLDER "bgfx/3rdparty" )

View File

@@ -4,5 +4,22 @@ include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
get_target_property(BGFX_INCLUDE_PATH bgfx::bgfx INTERFACE_INCLUDE_DIRECTORIES)
list(GET BGFX_INCLUDE_PATH 0 BGFX_INCLUDE_PATH_1) # bgfx::bgfx exports include directory twice?
set(BGFX_SHADER_INCLUDE_PATH ${BGFX_INCLUDE_PATH_1}/bgfx)
# If cross compiling, we need a host-compatible version of shaderc to compile shaders
if (@CMAKE_CROSSCOMPILING@ AND NOT TARGET bgfx::shaderc)
find_program(
shaderc_EXECUTABLE REQUIRED
NAMES bgfx-shaderc shaderc
PATHS /usr/bin
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/bgfx_x64-linux/tools/bgfx
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/bgfx_x64-windows/tools/bgfx
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/bgfx_x64-osx/tools/bgfx
)
add_executable(bgfx::shaderc IMPORTED)
set_target_properties(
bgfx::shaderc PROPERTIES IMPORTED_LOCATION "${shaderc_EXECUTABLE}"
)
endif ()
include("${CMAKE_CURRENT_LIST_DIR}/bgfxToolUtils.cmake")
check_required_components("@PROJECT_NAME@")

View File

@@ -68,6 +68,33 @@ if( NOT ${BGFX_OPENGLES_VERSION} STREQUAL "" )
target_compile_definitions( bgfx PRIVATE BGFX_CONFIG_RENDERER_OPENGLES_MIN_VERSION=${BGFX_OPENGLES_VERSION} )
endif()
if( NOT ${BGFX_CONFIG_DEFAULT_MAX_ENCODERS} STREQUAL "" )
target_compile_definitions( bgfx
PUBLIC
"BGFX_CONFIG_DEFAULT_MAX_ENCODERS=$<IF:$<BOOL:${BGFX_CONFIG_MULTITHREADED}>,${BGFX_CONFIG_DEFAULT_MAX_ENCODERS},1>" )
endif()
set(BGFX_CONFIG_OPTIONS "")
list(APPEND BGFX_CONFIG_OPTIONS
"BGFX_CONFIG_MAX_DRAW_CALLS"
"BGFX_CONFIG_MAX_VIEWS"
"BGFX_CONFIG_MAX_FRAME_BUFFERS"
"BGFX_CONFIG_MAX_VERTEX_LAYOUTS"
"BGFX_CONFIG_MAX_VERTEX_BUFFERS"
"BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS"
"BGFX_CONFIG_MAX_INDEX_BUFFERS"
"BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS"
"BGFX_CONFIG_MAX_TEXTURES"
"BGFX_CONFIG_MAX_TEXTURE_SAMPLERS"
"BGFX_CONFIG_MAX_SHADERS"
"BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM"
)
foreach(BGFX_CONFIG_OPTION IN LISTS BGFX_CONFIG_OPTIONS)
if( NOT ${${BGFX_CONFIG_OPTION}} STREQUAL "" )
target_compile_definitions( bgfx PUBLIC "${BGFX_CONFIG_OPTION}=${${BGFX_CONFIG_OPTION}}" )
endif()
endforeach()
# Special Visual Studio Flags
if( MSVC )
target_compile_definitions( bgfx PRIVATE "_CRT_SECURE_NO_WARNINGS" )
@@ -80,11 +107,24 @@ target_compile_definitions(bgfx
"BGFX_CONFIG_MULTITHREADED=$<BOOL:${BGFX_CONFIG_MULTITHREADED}>"
)
# directx-headers
set (DIRECTX_HEADERS)
if (UNIX AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ANDROID) # Only Linux
set (DIRECTX_HEADERS
${BGFX_DIR}/3rdparty/directx-headers/include/directx
${BGFX_DIR}/3rdparty/directx-headers/include
${BGFX_DIR}/3rdparty/directx-headers/include/wsl/stubs )
elseif (WIN32) # Only Windows
set (DIRECTX_HEADERS
${BGFX_DIR}/3rdparty/directx-headers/include/directx
${BGFX_DIR}/3rdparty/directx-headers/include )
endif()
# Includes
target_include_directories( bgfx
PRIVATE
${DIRECTX_HEADERS}
${BGFX_DIR}/3rdparty
${BGFX_DIR}/3rdparty/dxsdk/include
${BGFX_DIR}/3rdparty/khronos
PUBLIC
$<BUILD_INTERFACE:${BGFX_DIR}/include>

View File

@@ -9,8 +9,7 @@
# this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
# Third party libs
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/astc-codec.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/astc.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/3rdparty/astc-encoder.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 )
@@ -39,7 +38,7 @@ target_include_directories( bimg
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
# bimg dependencies
target_link_libraries( bimg PUBLIC bx PRIVATE astc-codec astc edtaa3 etc1 etc2 iqa squish nvtt pvrtc tinyexr )
target_link_libraries( bimg PUBLIC bx PRIVATE astc-encoder edtaa3 etc1 etc2 iqa squish nvtt pvrtc tinyexr )
# Put in a "bgfx" folder in Visual Studio
set_target_properties( bimg PROPERTIES FOLDER "bgfx" )

View File

@@ -59,11 +59,16 @@ elseif( WIN32 )
PUBLIC
$<BUILD_INTERFACE:${BX_DIR}/include/compat/msvc>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/compat/msvc> )
elseif( APPLE )
elseif( APPLE ) # APPLE is technically UNIX... ORDERING MATTERS!
target_include_directories( bx
PUBLIC
$<BUILD_INTERFACE:${BX_DIR}/include/compat/osx>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/compat/osx> )
$<BUILD_INTERFACE:${BX_DIR}/include/compat/osx>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/compat/osx> )
elseif ( UNIX )
target_include_directories( bx
PUBLIC
$<BUILD_INTERFACE:${BX_DIR}/include/compat/linux>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/compat/linux> )
endif()
# All configurations

View File

@@ -13,8 +13,16 @@ if( BGFX_CUSTOM_TARGETS )
set_target_properties( tools PROPERTIES FOLDER "bgfx/tools" )
endif()
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 )
if( BGFX_BUILD_TOOLS_SHADER )
include( ${CMAKE_CURRENT_LIST_DIR}/tools/shaderc.cmake )
endif()
if( BGFX_BUILD_TOOLS_GEOMETRY )
include( ${CMAKE_CURRENT_LIST_DIR}/tools/geometryc.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/tools/geometryv.cmake )
endif()
if( BGFX_BUILD_TOOLS_TEXTURE )
include( ${CMAKE_CURRENT_LIST_DIR}/tools/texturec.cmake )
include( ${CMAKE_CURRENT_LIST_DIR}/tools/texturev.cmake )
endif()