mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-17 21:12:35 +01:00
Compare commits
37 Commits
v1.115.795
...
v1.115.808
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7ac0aa3ae | ||
|
|
163661a07e | ||
|
|
99b9c1e852 | ||
|
|
28ea11be6d | ||
|
|
0006784f70 | ||
|
|
819719a4f9 | ||
|
|
5b34c97f4c | ||
|
|
4846036666 | ||
|
|
3168a4660e | ||
|
|
b5879646bb | ||
|
|
9426a2f44f | ||
|
|
3cf48b42d1 | ||
|
|
b5192910f9 | ||
|
|
b44793b740 | ||
|
|
1b74840891 | ||
|
|
b193a31651 | ||
|
|
146a9f43b0 | ||
|
|
9f3943b829 | ||
|
|
f81d8ee146 | ||
|
|
d65bbd523e | ||
|
|
d3449c2f68 | ||
|
|
0745f23a13 | ||
|
|
0424ae3763 | ||
|
|
72bc1cf167 | ||
|
|
7e7a6795a1 | ||
|
|
93c9e73a42 | ||
|
|
0f1a5a91e6 | ||
|
|
a01e8e043f | ||
|
|
5205429de2 | ||
|
|
25f2107994 | ||
|
|
75b9076904 | ||
|
|
de4c88ac51 | ||
|
|
d575656458 | ||
|
|
d3260f172c | ||
|
|
f290d91828 | ||
|
|
23577764fe | ||
|
|
ec90e950f1 |
2
.github/dependabot.yml
vendored
2
.github/dependabot.yml
vendored
@@ -3,4 +3,4 @@ updates:
|
||||
- package-ecosystem: "gitsubmodule"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
interval: "monthly"
|
||||
|
||||
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
@@ -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
1
.gitignore
vendored
@@ -13,3 +13,4 @@ install_manifest.txt
|
||||
generated/*
|
||||
!generated/*.in
|
||||
cmake_install.cmake
|
||||
.cache/
|
||||
@@ -28,7 +28,6 @@ option( BGFX_INSTALL_EXAMPLES "Install examples and their runtimes." OF
|
||||
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 )
|
||||
|
||||
set( BGFX_OPENGL_VERSION "" CACHE STRING "Specify minimum opengl version" )
|
||||
@@ -58,19 +57,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 +110,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
2
bgfx
Submodule bgfx updated: 6573fc44a8...ae7aeba72c
2
bimg
2
bimg
Submodule bimg updated: 6693de0e50...663f724186
2
bx
2
bx
Submodule bx updated: 11c3c5e615...ad018d47c6
@@ -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,9 @@ 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>")
|
||||
|
||||
# Includes
|
||||
target_include_directories( bgfx
|
||||
PRIVATE
|
||||
@@ -86,15 +87,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 )
|
||||
|
||||
@@ -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} )
|
||||
|
||||
@@ -67,10 +67,7 @@ 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 )
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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 )
|
||||
|
||||
@@ -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" )
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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" )
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user