mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-17 21:12:35 +01:00
Compare commits
41 Commits
v1.118.849
...
v1.128.878
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94184872a8 | ||
|
|
4ceffda6de | ||
|
|
8defeece11 | ||
|
|
5b8c8b9057 | ||
|
|
de5f4544ef | ||
|
|
85b9f3cf5f | ||
|
|
79e4993ca5 | ||
|
|
0211a63b99 | ||
|
|
1156dcc725 | ||
|
|
c2b7416a58 | ||
|
|
c0ce1388cc | ||
|
|
19cb98d40b | ||
|
|
701d84c222 | ||
|
|
5940bb7cf8 | ||
|
|
2fcbf437f2 | ||
|
|
d7f59648a8 | ||
|
|
e8db646d2c | ||
|
|
e12aba94c7 | ||
|
|
8dcc50e992 | ||
|
|
011e8efe23 | ||
|
|
871eed8f8a | ||
|
|
2f0e950b8f | ||
|
|
26af75d78b | ||
|
|
1f65bfcb44 | ||
|
|
875927a712 | ||
|
|
f46699bb4a | ||
|
|
6a8aba37ff | ||
|
|
38de01cd8a | ||
|
|
560dcb227e | ||
|
|
b3dae62c95 | ||
|
|
a1a7828ab0 | ||
|
|
11810052be | ||
|
|
688224d5f0 | ||
|
|
3c1f8bac82 | ||
|
|
ec52497189 | ||
|
|
1925f436e7 | ||
|
|
b208d0c37b | ||
|
|
b5041def8e | ||
|
|
29b62260f6 | ||
|
|
4cfb204f26 | ||
|
|
715b2a2c67 |
1
.github/CODEOWNERS
vendored
Normal file
1
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1 @@
|
||||
* @bwrsandman
|
||||
5
.github/dependabot.yml
vendored
5
.github/dependabot.yml
vendored
@@ -4,3 +4,8 @@ updates:
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "monthly"
|
||||
groups:
|
||||
# Name of the group
|
||||
submodules:
|
||||
patterns:
|
||||
- "*"
|
||||
|
||||
59
.github/workflows/release.yml
vendored
59
.github/workflows/release.yml
vendored
@@ -97,79 +97,82 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
path: src/bgfx.cmake
|
||||
- run: |
|
||||
find src/bgfx.cmake -name ".git*" -exec rm -rf {} +
|
||||
find src/bgfx.cmake -name ".editorconfig" -delete
|
||||
rm src/bgfx.cmake/.cmake-format.py
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: windows-latest
|
||||
path: ${{ github.workspace }}/install/windows
|
||||
path: ${{ github.workspace }}/install/windows/bgfx.cmake
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ubuntu-latest
|
||||
path: ${{ github.workspace }}/install/linux
|
||||
path: ${{ github.workspace }}/install/linux/bgfx.cmake
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: macos-latest
|
||||
path: ${{ github.workspace }}/install/macos
|
||||
path: ${{ github.workspace }}/install/macos/bgfx.cmake
|
||||
- name: Create Source Zip
|
||||
uses: thedoctor0/zip-release@0.7.1
|
||||
with:
|
||||
type: 'zip'
|
||||
filename: 'release.${{ needs.version.outputs.tag }}.zip'
|
||||
directory: '..'
|
||||
filename: 'bgfx.cmake.${{ needs.version.outputs.tag }}.zip'
|
||||
directory: 'src'
|
||||
path: 'bgfx.cmake'
|
||||
exclusions: '.git* .cmake-format.py .editorconfig install'
|
||||
- name: Create Source Tar
|
||||
uses: thedoctor0/zip-release@0.7.1
|
||||
with:
|
||||
type: 'tar'
|
||||
filename: 'release.${{ needs.version.outputs.tag }}.tar.gz'
|
||||
directory: '..'
|
||||
filename: 'bgfx.cmake.${{ needs.version.outputs.tag }}.tar.gz'
|
||||
directory: 'src'
|
||||
path: 'bgfx.cmake'
|
||||
exclusions: '.git* .cmake-format.py .editorconfig install'
|
||||
- name: Create Windows Zip
|
||||
uses: thedoctor0/zip-release@0.7.1
|
||||
with:
|
||||
type: 'zip'
|
||||
filename: 'windows.${{ needs.version.outputs.tag }}.zip'
|
||||
directory: 'install'
|
||||
path: 'windows'
|
||||
filename: 'bgfx.cmake.binary.windows.${{ needs.version.outputs.tag }}.zip'
|
||||
directory: 'install/windows'
|
||||
path: 'bgfx.cmake'
|
||||
- name: Create Windows Tar
|
||||
uses: thedoctor0/zip-release@0.7.1
|
||||
with:
|
||||
type: 'tar'
|
||||
filename: 'windows.${{ needs.version.outputs.tag }}.tar.gz'
|
||||
directory: 'install'
|
||||
path: 'windows'
|
||||
filename: 'bgfx.cmake.binary.windows.${{ needs.version.outputs.tag }}.tar.gz'
|
||||
directory: 'install/windows'
|
||||
path: 'bgfx.cmake'
|
||||
- name: Create Linux Zip
|
||||
uses: thedoctor0/zip-release@0.7.1
|
||||
with:
|
||||
type: 'zip'
|
||||
filename: 'linux.${{ needs.version.outputs.tag }}.zip'
|
||||
directory: 'install'
|
||||
path: 'linux'
|
||||
filename: 'bgfx.cmake.binary.linux.${{ needs.version.outputs.tag }}.zip'
|
||||
directory: 'install/linux'
|
||||
path: 'bgfx.cmake'
|
||||
- name: Create Linux Tar
|
||||
uses: thedoctor0/zip-release@0.7.1
|
||||
with:
|
||||
type: 'tar'
|
||||
filename: 'linux.${{ needs.version.outputs.tag }}.tar.gz'
|
||||
directory: 'install'
|
||||
path: 'linux'
|
||||
filename: 'bgfx.cmake.binary.linux.${{ needs.version.outputs.tag }}.tar.gz'
|
||||
directory: 'install/linux'
|
||||
path: 'bgfx.cmake'
|
||||
- name: Create MacOS Zip
|
||||
uses: thedoctor0/zip-release@0.7.1
|
||||
with:
|
||||
type: 'zip'
|
||||
filename: 'macos.${{ needs.version.outputs.tag }}.zip'
|
||||
directory: 'install'
|
||||
path: 'macos'
|
||||
filename: 'bgfx.cmake.binary.macos.${{ needs.version.outputs.tag }}.zip'
|
||||
directory: 'install/macos'
|
||||
path: 'bgfx.cmake'
|
||||
- name: Create MacOS Tar
|
||||
uses: thedoctor0/zip-release@0.7.1
|
||||
with:
|
||||
type: 'tar'
|
||||
filename: 'macos.${{ needs.version.outputs.tag }}.tar.gz'
|
||||
directory: 'install'
|
||||
path: 'macos'
|
||||
filename: 'bgfx.cmake.binary.macos.${{ needs.version.outputs.tag }}.tar.gz'
|
||||
directory: 'install/macos'
|
||||
path: 'bgfx.cmake'
|
||||
- name: Create Release
|
||||
uses: ncipollo/release-action@v1
|
||||
with:
|
||||
tag: ${{ needs.version.outputs.tag }}
|
||||
artifacts: "../release.${{ needs.version.outputs.tag }}.zip ../release.${{ needs.version.outputs.tag }}.tar.gz install/*.${{ needs.version.outputs.tag }}.zip install/*.${{ needs.version.outputs.tag }}.tar.gz"
|
||||
artifacts: "src/bgfx.cmake.${{ needs.version.outputs.tag }}.zip,src/bgfx.cmake.${{ needs.version.outputs.tag }}.tar.gz,install/*/*.${{ needs.version.outputs.tag }}.zip,install/*/*.${{ needs.version.outputs.tag }}.tar.gz"
|
||||
generateReleaseNotes: true
|
||||
|
||||
@@ -13,7 +13,7 @@ project(bgfx)
|
||||
cmake_policy(SET CMP0054 NEW)
|
||||
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
@@ -22,10 +22,6 @@ if(APPLE AND NOT XCODE)
|
||||
set(CMAKE_CXX_FLAGS "-ObjC++")
|
||||
endif()
|
||||
|
||||
if(MSVC AND (MSVC_VERSION GREATER_EQUAL 1914))
|
||||
add_compile_options("/Zc:__cplusplus")
|
||||
endif()
|
||||
|
||||
include(CMakeDependentOption)
|
||||
|
||||
option(BX_AMALGAMATED "Amalgamated bx build for faster compilation" OFF)
|
||||
@@ -38,11 +34,16 @@ cmake_dependent_option(BGFX_BUILD_TOOLS_GEOMETRY "Build bgfx geometry tools." ON
|
||||
cmake_dependent_option(BGFX_BUILD_TOOLS_TEXTURE "Build bgfx texture tools." ON BGFX_BUILD_TOOLS OFF)
|
||||
set(BGFX_TOOLS_PREFIX "" CACHE STRING "Prefix name to add to name of tools (to avoid clashes)")
|
||||
option(BGFX_BUILD_EXAMPLES "Build bgfx examples." ON)
|
||||
cmake_dependent_option(
|
||||
BGFX_BUILD_EXAMPLE_COMMON "Build bgfx example-common project." OFF "NOT BGFX_BUILD_EXAMPLES;NOT BGFX_BUILD_TOOLS"
|
||||
ON
|
||||
)
|
||||
option(BGFX_BUILD_TESTS "Build bgfx tests." OFF)
|
||||
option(BGFX_INSTALL "Create installation target." ON)
|
||||
cmake_dependent_option(
|
||||
BGFX_INSTALL_EXAMPLES "Install examples and their runtimes." OFF "BGFX_INSTALL;BGFX_BUILD_EXAMPLES" OFF
|
||||
)
|
||||
cmake_dependent_option(BGFX_WITH_WAYLAND "Use Wayland backend." ON "CMAKE_SYSTEM_NAME STREQUAL 'Linux'" OFF)
|
||||
option(BGFX_CUSTOM_TARGETS "Include convenience custom targets." ON)
|
||||
option(BGFX_CONFIG_MULTITHREADED "Build bgfx with multithreaded configuration" ON)
|
||||
option(BGFX_CONFIG_RENDERER_WEBGPU "Enable the webgpu renderer" OFF)
|
||||
@@ -160,18 +161,6 @@ if(BGFX_INSTALL)
|
||||
|
||||
install(FILES ${BGFX_DIR}/LICENSE DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/licences/${PROJECT_NAME})
|
||||
|
||||
# install headers (this should be done as a target probably... ^)
|
||||
install(DIRECTORY ${BX_DIR}/include/bx ${BX_DIR}/include/compat ${BX_DIR}/include/tinystl
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
)
|
||||
install(DIRECTORY ${BIMG_DIR}/include/bimg DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
install(DIRECTORY ${BGFX_DIR}/include/bgfx DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
# header required for shader compilation
|
||||
install(FILES ${BGFX_DIR}/src/bgfx_shader.sh ${BGFX_DIR}/src/bgfx_compute.sh
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/bgfx"
|
||||
)
|
||||
|
||||
# install tools
|
||||
if(BGFX_CMAKE_USER_SCRIPT)
|
||||
install(FILES ${BGFX_CMAKE_USER_SCRIPT} DESTINATION "${config_install_dir}")
|
||||
|
||||
39
README.md
39
README.md
@@ -48,8 +48,9 @@ Adding these `INPUT_FILE` as source files to a target will run `bin2c` at build
|
||||
#### Examples: Generating an image as a header
|
||||
```cmake
|
||||
bgfx_compile_binary_to_header(
|
||||
INPUT_FILE image.png
|
||||
INPUT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/image.png
|
||||
OUTPUT_FILE ${CMAKE_BINARY_DIR}/include/generated/images/image.png.h
|
||||
ARRAY_NAME image_bytes
|
||||
)
|
||||
add_library(myLib image.png)
|
||||
target_include_directories(myLib ${CMAKE_BINARY_DIR}/include/generated/images)
|
||||
@@ -58,6 +59,7 @@ target_include_directories(myLib ${CMAKE_BINARY_DIR}/include/generated/images)
|
||||
```cpp
|
||||
// main.cpp
|
||||
#include <image.png.h>
|
||||
// You now have access to a static const uint8_t or char array named image_bytes
|
||||
```
|
||||
|
||||
### `bgfx_compile_texture`
|
||||
@@ -84,35 +86,38 @@ bgfx_compile_texture(
|
||||
)
|
||||
```
|
||||
|
||||
### `bgfx_compile_shader_to_header`
|
||||
### `bgfx_compile_shaders`
|
||||
Add a build rule for a `*.sc` shader to the generated build system using shaderc.
|
||||
```cmake
|
||||
bgfx_compile_shader_to_header(
|
||||
bgfx_compile_shaders(
|
||||
TYPE VERTEX|FRAGMENT|COMPUTE
|
||||
SHADERS filenames
|
||||
VARYING_DEF filename
|
||||
OUTPUT_DIR directory
|
||||
[AS_HEADER]
|
||||
)
|
||||
```
|
||||
This defines a shaderc command to generate headers for a number of `TYPE` shaders with `SHADERS` files and `VARYING_DEF` file in the `OUTPUT_DIR` directory. There will be one generated shader for each supported rendering API on this current platform according to the `BGFX_EMBEDDED_SHADER` macro in `bgfx/embedded_shader.h`.
|
||||
This defines a shaderc command to generate binaries or headers for a number of `TYPE` shaders with `SHADERS` files and `VARYING_DEF` file in the `OUTPUT_DIR` directory. There will be one generated shader for each supported rendering API on this current platform according to the `BGFX_EMBEDDED_SHADER` macro in `bgfx/embedded_shader.h` for headers and in the directory expected by `load_shader` in `bgfx_utils.h`.
|
||||
|
||||
The generated headers will have names in the format of `${SHADERS}.${RENDERING_API}.bin.h` where `RENDERING_API` can be `glsl`, `essl`, `spv`, `dx9`, `dx11` and `mtl` depending on the availability of the platform.
|
||||
The generated headers will have names in the format of `${RENDERING_API}/${SHADERS}.bin[.h]` where `RENDERING_API` can be `glsl`, `essl`, `spv`, `dx11` and `mtl` depending on the availability of the platform.
|
||||
|
||||
Adding these `SHADERS` as source files to a target will run `shaderc` at build time and they will rebuild if either the contents of the `SHADERS` or the `VARYING_DEF` change.
|
||||
|
||||
#### Examples: Generating shaders as headers
|
||||
```cmake
|
||||
bgfx_compile_shader_to_header(
|
||||
bgfx_compile_shaders(
|
||||
TYPE VERTEX
|
||||
SHADERS vs.sc
|
||||
VARYING_DEF varying.def.sc
|
||||
OUTPUT_DIR ${CMAKE_BINARY_DIR}/include/generated/shaders
|
||||
AS_HEADER
|
||||
)
|
||||
bgfx_compile_shader_to_header(
|
||||
TYPE FRAGMENT
|
||||
SHADERS fs.sc
|
||||
VARYING_DEF ${CMAKE_SOURCE_DIR}/varying.def.sc
|
||||
OUTPUT_DIR ${CMAKE_BINARY_DIR}/include/generated/shaders
|
||||
AS_HEADER
|
||||
)
|
||||
|
||||
add_library(myLib main.cpp vs.sc fs.sc)
|
||||
@@ -121,21 +126,19 @@ target_include_directories(myLib ${CMAKE_BINARY_DIR}/include/generated/shaders)
|
||||
|
||||
```cpp
|
||||
// main.cpp
|
||||
#include <vs.sc.glsl.bin.h>
|
||||
#include <vs.sc.essl.bin.h>
|
||||
#include <vs.sc.spv.bin.h>
|
||||
#include <fs.sc.glsl.bin.h>
|
||||
#include <fs.sc.essl.bin.h>
|
||||
#include <fs.sc.spv.bin.h>
|
||||
#include <glsl/vs.sc.bin.h>
|
||||
#include <essl/vs.sc.bin.h>
|
||||
#include <spv/vs.sc.bin.h>
|
||||
#include <glsl/fs.sc.bin.h>
|
||||
#include <essl/fs.sc.bin.h>
|
||||
#include <spv/fs.sc.bin.h>
|
||||
#if defined(_WIN32)
|
||||
#include <vs.sc.dx9.bin.h>
|
||||
#include <vs.sc.dx11.bin.h>
|
||||
#include <fs.sc.dx9.bin.h>
|
||||
#include <fs.sc.dx11.bin.h>
|
||||
#include <dx11/vs.sc.bin.h>
|
||||
#include <dx11/fs.sc.bin.h>
|
||||
#endif // defined(_WIN32)
|
||||
#if __APPLE__
|
||||
#include <vs.sc.mtl.bin.h>
|
||||
#include <fs.sc.mtl.bin.h>
|
||||
#include <mtl/vs.sc.bin.h>
|
||||
#include <mtl/fs.sc.bin.h>
|
||||
#endif // __APPLE__
|
||||
|
||||
const bgfx::EmbeddedShader k_vs = BGFX_EMBEDDED_SHADER(vs);
|
||||
|
||||
2
bgfx
2
bgfx
Submodule bgfx updated: e7e75e4bff...409fbc5d14
2
bimg
2
bimg
Submodule bimg updated: ec02df824a...aaf9125234
2
bx
2
bx
Submodule bx updated: 7ac95d5131...3d53a4abaa
@@ -9,28 +9,23 @@ list(GET BGFX_INCLUDE_PATH 0 BGFX_INCLUDE_PATH_1) # bgfx::bgfx exports include d
|
||||
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@)
|
||||
macro(_bgfx_crosscompile_use_host_tool TOOL_NAME)
|
||||
if(NOT TARGET bgfx::${TOOL_NAME})
|
||||
find_program(
|
||||
${TOOL_NAME}_EXECUTABLE REQUIRED
|
||||
NAMES bgfx-${TOOL_NAME} ${TOOL_NAME}
|
||||
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::${TOOL_NAME} IMPORTED)
|
||||
set_target_properties(bgfx::${TOOL_NAME} PROPERTIES IMPORTED_LOCATION "${${TOOL_NAME}_EXECUTABLE}")
|
||||
endif()
|
||||
endmacro()
|
||||
macro(_bgfx_crosscompile_use_host_tool TOOL_NAME)
|
||||
if(NOT TARGET bgfx::${TOOL_NAME})
|
||||
find_program(
|
||||
${TOOL_NAME}_EXECUTABLE
|
||||
NAMES bgfx-${TOOL_NAME} ${TOOL_NAME}
|
||||
PATHS @BGFX_ADDITIONAL_TOOL_PATHS@ /usr/bin
|
||||
)
|
||||
add_executable(bgfx::${TOOL_NAME} IMPORTED)
|
||||
set_target_properties(bgfx::${TOOL_NAME} PROPERTIES IMPORTED_LOCATION "${${TOOL_NAME}_EXECUTABLE}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
_bgfx_crosscompile_use_host_tool(bin2c)
|
||||
_bgfx_crosscompile_use_host_tool(texturec)
|
||||
_bgfx_crosscompile_use_host_tool(shaderc)
|
||||
_bgfx_crosscompile_use_host_tool(texturev)
|
||||
_bgfx_crosscompile_use_host_tool(geometryv)
|
||||
endif()
|
||||
_bgfx_crosscompile_use_host_tool(bin2c)
|
||||
_bgfx_crosscompile_use_host_tool(texturec)
|
||||
_bgfx_crosscompile_use_host_tool(shaderc)
|
||||
_bgfx_crosscompile_use_host_tool(texturev)
|
||||
_bgfx_crosscompile_use_host_tool(geometryv)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/bgfxToolUtils.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
||||
|
||||
@@ -12,9 +12,6 @@ include(bgfx.cmake)
|
||||
include(3rdparty/meshoptimizer.cmake)
|
||||
include(3rdparty/dear-imgui.cmake)
|
||||
|
||||
include(shared.cmake)
|
||||
include(examples.cmake)
|
||||
|
||||
if(BGFX_BUILD_TOOLS_TEXTURE)
|
||||
include(texturev.cmake)
|
||||
endif()
|
||||
@@ -31,3 +28,6 @@ if(BGFX_BUILD_TOOLS_SHADER)
|
||||
include(3rdparty/webgpu.cmake)
|
||||
include(shaderc.cmake)
|
||||
endif()
|
||||
|
||||
include(shared.cmake)
|
||||
include(examples.cmake)
|
||||
|
||||
@@ -85,6 +85,10 @@ if(NOT ${BGFX_CONFIG_DEFAULT_MAX_ENCODERS} STREQUAL "")
|
||||
)
|
||||
endif()
|
||||
|
||||
if(BGFX_WITH_WAYLAND)
|
||||
target_compile_definitions(bgfx PRIVATE "WL_EGL_PLATFORM=1")
|
||||
endif()
|
||||
|
||||
set(BGFX_CONFIG_OPTIONS "")
|
||||
list(
|
||||
APPEND
|
||||
@@ -217,4 +221,11 @@ if(BGFX_INSTALL)
|
||||
INCLUDES
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
)
|
||||
|
||||
install(DIRECTORY ${BGFX_DIR}/include/bgfx DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
||||
# header required for shader compilation
|
||||
install(FILES ${BGFX_DIR}/src/bgfx_shader.sh ${BGFX_DIR}/src/bgfx_compute.sh
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/bgfx"
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -33,19 +33,6 @@ function(add_bgfx_shader FILE FOLDER)
|
||||
set(OUTPUTS_PRETTY "")
|
||||
|
||||
if(WIN32)
|
||||
# dx9
|
||||
if(NOT "${TYPE}" STREQUAL "COMPUTE")
|
||||
set(DX9_OUTPUT ${BGFX_DIR}/examples/runtime/shaders/dx9/${FILENAME}.bin)
|
||||
_bgfx_shaderc_parse(
|
||||
DX9 ${COMMON} WINDOWS
|
||||
PROFILE s_3_0
|
||||
O 3
|
||||
OUTPUT ${DX9_OUTPUT}
|
||||
)
|
||||
list(APPEND OUTPUTS "DX9")
|
||||
set(OUTPUTS_PRETTY "${OUTPUTS_PRETTY}DX9, ")
|
||||
endif()
|
||||
|
||||
# dx11
|
||||
set(DX11_OUTPUT ${BGFX_DIR}/examples/runtime/shaders/dx11/${FILENAME}.bin)
|
||||
if(NOT "${TYPE}" STREQUAL "COMPUTE")
|
||||
@@ -78,7 +65,7 @@ function(add_bgfx_shader FILE FOLDER)
|
||||
# essl
|
||||
if(NOT "${TYPE}" STREQUAL "COMPUTE")
|
||||
set(ESSL_OUTPUT ${BGFX_DIR}/examples/runtime/shaders/essl/${FILENAME}.bin)
|
||||
_bgfx_shaderc_parse(ESSL ${COMMON} ANDROID OUTPUT ${ESSL_OUTPUT})
|
||||
_bgfx_shaderc_parse(ESSL ${COMMON} ANDROID PROFILE 100_es OUTPUT ${ESSL_OUTPUT})
|
||||
list(APPEND OUTPUTS "ESSL")
|
||||
set(OUTPUTS_PRETTY "${OUTPUTS_PRETTY}ESSL, ")
|
||||
endif()
|
||||
@@ -276,17 +263,19 @@ if(BGFX_CUSTOM_TARGETS)
|
||||
endif()
|
||||
|
||||
# Add common library for examples
|
||||
add_example(
|
||||
common
|
||||
COMMON
|
||||
DIRECTORIES
|
||||
${BGFX_DIR}/examples/common/debugdraw
|
||||
${BGFX_DIR}/examples/common/entry
|
||||
${BGFX_DIR}/examples/common/font
|
||||
${BGFX_DIR}/examples/common/imgui
|
||||
${BGFX_DIR}/examples/common/nanovg
|
||||
${BGFX_DIR}/examples/common/ps
|
||||
)
|
||||
if(BGFX_BUILD_EXAMPLE_COMMON)
|
||||
add_example(
|
||||
common
|
||||
COMMON
|
||||
DIRECTORIES
|
||||
${BGFX_DIR}/examples/common/debugdraw
|
||||
${BGFX_DIR}/examples/common/entry
|
||||
${BGFX_DIR}/examples/common/font
|
||||
${BGFX_DIR}/examples/common/imgui
|
||||
${BGFX_DIR}/examples/common/nanovg
|
||||
${BGFX_DIR}/examples/common/ps
|
||||
)
|
||||
endif()
|
||||
|
||||
# Only add examples if set, otherwise we still need exmaples common for tools
|
||||
if(BGFX_BUILD_EXAMPLES)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include "@BGFX_DIR@/src/shader.cpp"
|
||||
#include "@BGFX_DIR@/src/shader_dx9bc.cpp"
|
||||
#include "@BGFX_DIR@/src/shader_dxbc.cpp"
|
||||
#include "@BGFX_DIR@/src/shader_spirv.cpp"
|
||||
#include "@BGFX_DIR@/src/shader_spirv.cpp"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -43,7 +43,7 @@ target_link_libraries(
|
||||
${MINIZ_LIBRARIES} #
|
||||
)
|
||||
|
||||
if(BGFX_INSTALL AND NOT BGFX_LIBRARY_TYPE MATCHES "SHARED")
|
||||
if(BGFX_INSTALL)
|
||||
install(
|
||||
TARGETS bimg
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
@@ -53,4 +53,5 @@ if(BGFX_INSTALL AND NOT BGFX_LIBRARY_TYPE MATCHES "SHARED")
|
||||
INCLUDES
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
)
|
||||
install(DIRECTORY ${BIMG_DIR}/include/bimg DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
endif()
|
||||
|
||||
@@ -81,7 +81,7 @@ target_include_directories(
|
||||
$<BUILD_INTERFACE:${BX_DIR}/3rdparty> #
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> #
|
||||
$<BUILD_INTERFACE:${BX_DIR}/include/compat/${BX_COMPAT_PLATFORM}> #
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/compat/${BX_COMPAT_PLATFORM}> #
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/bx/compat/${BX_COMPAT_PLATFORM}> #
|
||||
)
|
||||
|
||||
# All configurations
|
||||
@@ -92,7 +92,7 @@ target_compile_definitions(bx PUBLIC "__STDC_CONSTANT_MACROS")
|
||||
|
||||
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>)
|
||||
target_compile_options(bx PUBLIC $<$<CXX_COMPILER_ID:MSVC>:/Zc:__cplusplus /Zc:preprocessor>)
|
||||
|
||||
# Link against psapi on Windows
|
||||
if(WIN32)
|
||||
@@ -121,14 +121,18 @@ endif()
|
||||
# Put in a "bgfx" folder in Visual Studio
|
||||
set_target_properties(bx PROPERTIES FOLDER "bgfx")
|
||||
|
||||
if(NOT BGFX_LIBRARY_TYPE MATCHES "SHARED")
|
||||
if(BGFX_INSTALL)
|
||||
install(
|
||||
TARGETS bx
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
|
||||
INCLUDES
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||
)
|
||||
# We will make sure tinystl and compat are not installed in /usr/include
|
||||
install(DIRECTORY "${BX_DIR}/include/bx" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
install(DIRECTORY "${BX_DIR}/include/compat/${BX_COMPAT_PLATFORM}"
|
||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/bx/compat"
|
||||
)
|
||||
install(DIRECTORY "${BX_DIR}/include/tinystl" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/bx")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user