mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-17 21:12:35 +01:00
Compare commits
38 Commits
v1.115.806
...
v1.115.818
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65dde3874d | ||
|
|
f6a9fb1687 | ||
|
|
f1eed47138 | ||
|
|
9ac6e08121 | ||
|
|
6c75503da4 | ||
|
|
3dcf049202 | ||
|
|
3ec2a51aef | ||
|
|
26a0f1e54d | ||
|
|
896ab5478c | ||
|
|
23a1dc204a | ||
|
|
5fa58aad11 | ||
|
|
8dafd0d9e4 | ||
|
|
3bac602264 | ||
|
|
1b2b921bde | ||
|
|
374dcbba70 | ||
|
|
95af1cc54d | ||
|
|
e85f8c0f3c | ||
|
|
9ecbe9ee51 | ||
|
|
d725e78f86 | ||
|
|
93de01a1af | ||
|
|
dd2017c332 | ||
|
|
ead887f59b | ||
|
|
f184835827 | ||
|
|
a7ac0aa3ae | ||
|
|
163661a07e | ||
|
|
99b9c1e852 | ||
|
|
28ea11be6d | ||
|
|
0006784f70 | ||
|
|
819719a4f9 | ||
|
|
5b34c97f4c | ||
|
|
4846036666 | ||
|
|
3168a4660e | ||
|
|
b5879646bb | ||
|
|
9426a2f44f | ||
|
|
3cf48b42d1 | ||
|
|
b5192910f9 | ||
|
|
93c9e73a42 | ||
|
|
0f1a5a91e6 |
2
.github/dependabot.yml
vendored
2
.github/dependabot.yml
vendored
@@ -3,4 +3,4 @@ updates:
|
||||
- package-ecosystem: "gitsubmodule"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "daily"
|
||||
interval: "monthly"
|
||||
|
||||
@@ -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
2
bgfx
Submodule bgfx updated: 9f04292f40...db44d5675f
2
bimg
2
bimg
Submodule bimg updated: 9d6af16116...663f724186
2
bx
2
bx
Submodule bx updated: c969169fc1...aa5090bbd8
8
cmake/3rdparty/glsl-optimizer.cmake
vendored
8
cmake/3rdparty/glsl-optimizer.cmake
vendored
@@ -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
|
||||
|
||||
@@ -70,12 +70,11 @@ if( MSVC )
|
||||
endif()
|
||||
|
||||
# Add debug config required in bx headers since bx is private
|
||||
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
||||
target_compile_definitions( bgfx PUBLIC "BX_CONFIG_DEBUG=1" )
|
||||
else()
|
||||
target_compile_definitions( bgfx PUBLIC "BX_CONFIG_DEBUG=0" )
|
||||
endif()
|
||||
|
||||
target_compile_definitions(bgfx
|
||||
PUBLIC
|
||||
"BX_CONFIG_DEBUG=$<CONFIG:Debug>"
|
||||
"BGFX_CONFIG_MULTITHREADED=$<BOOL:${BGFX_CONFIG_MULTITHREADED}>"
|
||||
)
|
||||
|
||||
# Includes
|
||||
target_include_directories( bgfx
|
||||
|
||||
@@ -30,6 +30,10 @@ endif()
|
||||
# Create the bx target
|
||||
add_library( bx STATIC ${BX_SOURCES} )
|
||||
|
||||
target_compile_features( bx PUBLIC cxx_std_14 )
|
||||
# (note: see bx\scripts\toolchain.lua for equivalent compiler flag)
|
||||
target_compile_options( bx PUBLIC $<$<CXX_COMPILER_ID:MSVC>:/Zc:__cplusplus> )
|
||||
|
||||
# Link against psapi on Windows
|
||||
if( WIN32 )
|
||||
target_link_libraries( bx PUBLIC psapi )
|
||||
@@ -67,24 +71,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" )
|
||||
|
||||
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
||||
target_compile_definitions( bx PUBLIC "BX_CONFIG_DEBUG=1" )
|
||||
else()
|
||||
target_compile_definitions( bx PUBLIC "BX_CONFIG_DEBUG=0" )
|
||||
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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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