Skip to content

Commit

Permalink
Merge pull request bkaradzic#4 from e-erdal/master
Browse files Browse the repository at this point in the history
Make fork even with submodules
  • Loading branch information
exdal authored May 1, 2021
2 parents 051265e + 99ce23f commit 44aba91
Show file tree
Hide file tree
Showing 13 changed files with 135 additions and 178 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# https://github.com/openblack/bgfx.cmake/blob/master/.github/workflows/ci.yml
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
job:
name: ${{ matrix.os }} ${{ matrix.cc }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
- os: ubuntu-latest
cc: gcc
cxx: g++
- os: ubuntu-latest
cc: clang
cxx: clang++
- os: macos-latest
env:
# Indicates the CMake build directory where project files and binaries are being produced.
CMAKE_BUILD_DIR: ${{ github.workspace }}/build/

CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Linux dependencies
run: |
sudo apt install -y libgl1-mesa-dev
if: matrix.os == 'ubuntu-latest'

# Setup the build machine with the most recent versions of CMake and Ninja. Both are cached if not already: on subsequent runs both will be quickly restored from GitHub cache service.
- uses: lukka/get-cmake@latest

# On Windows runners, let's ensure to have the Developer Command Prompt environment setup correctly. As used here the Developer Command Prompt created is targeting x64 and using the default the Windows SDK.
- uses: ilammy/msvc-dev-cmd@v1

# Run CMake to generate Ninja project files
- name: Generate project files
run: |
cmake -B "${{ env.CMAKE_BUILD_DIR }}" -GNinja -DCMAKE_BUILD_TYPE=Release
# Build the whole project with Ninja (which is spawn by CMake).
- name: Build
run: |
cmake --build "${{ env.CMAKE_BUILD_DIR }}"
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# https://github.com/openblack/bgfx.cmake/blob/master/.github/workflows/release.yml

name: Release

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
job:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
- os: ubuntu-latest

env:
# Indicates the CMake build directory where project files and binaries are being produced.
CMAKE_BUILD_DIR: ${{ github.workspace }}/build/
CMAKE_INSTALL_DIR: ${{ github.workspace }}/install/

steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Linux dependencies
run: |
sudo apt install -y libgl1-mesa-dev
if: matrix.os == 'ubuntu-latest'

# Setup the build machine with the most recent versions of CMake and Ninja. Both are cached if not already: on subsequent runs both will be quickly restored from GitHub cache service.
- uses: lukka/get-cmake@latest

# On Windows runners, let's ensure to have the Developer Command Prompt environment setup correctly. As used here the Developer Command Prompt created is targeting x64 and using the default the Windows SDK.
- uses: ilammy/msvc-dev-cmd@v1

# 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
# 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:
name: ${{ matrix.os }}
path: ${{ github.workspace }}/install/
164 changes: 0 additions & 164 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
bgfx.cmake
===================
[![Build Status](https://travis-ci.org/bkaradzic/bgfx.cmake.svg?branch=master)](https://travis-ci.org/bkaradzic/bgfx.cmake)
[![Build Status](https://github.com/bkaradzic/bgfx.cmake/workflows/Release/badge.svg)](https://github.com/bkaradzic/bgfx.cmake/workflows/Release/badge.svg)

This repo contains a bunch of cmake files that can be used to build bgfx with CMake.

Expand Down
2 changes: 1 addition & 1 deletion bgfx
Submodule bgfx updated 2437 files
2 changes: 1 addition & 1 deletion bx
Submodule bx updated 132 files
7 changes: 5 additions & 2 deletions cmake/3rdparty/glslang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ endif()
file( GLOB GLSLANG_SOURCES
${BGFX_DIR}/3rdparty/glslang/glslang/GenericCodeGen/*.cpp
${BGFX_DIR}/3rdparty/glslang/glslang/MachineIndependent/*.cpp
${BGFX_DIR}/3rdparty/glslang/glslang/MachineIndependent/preprocessor/*.cpp
${BGFX_DIR}/3rdparty/glslang/glslang/MachineIndependent/preprocessor/*.cpp
${BGFX_DIR}/3rdparty/glslang/glslang/HLSL/*.cpp
${BGFX_DIR}/3rdparty/glslang/hlsl/*.cpp
${BGFX_DIR}/3rdparty/glslang/SPIRV/*.cpp
Expand All @@ -35,6 +35,9 @@ target_include_directories( glslang PUBLIC
${BGFX_DIR}/3rdparty/glslang
${BGFX_DIR}/3rdparty/glslang/glslang/Include
${BGFX_DIR}/3rdparty/glslang/glslang/Public

PRIVATE
${BGFX_DIR}/3rdparty
)

set_target_properties( glslang PROPERTIES FOLDER "bgfx/3rdparty" )
Expand Down Expand Up @@ -92,4 +95,4 @@ endif()
target_compile_definitions( glslang PRIVATE
ENABLE_OPT=1
ENABLE_HLSL=1
)
)
7 changes: 6 additions & 1 deletion cmake/examples.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,12 @@ if( BGFX_BUILD_EXAMPLES )
# 37-gpudrivenrendering
38-bloom
39-assao
# 40-svt
40-svt
# 41-tess
42-bunnylod
43-denoise
44-sss
45-bokeh
)

foreach( EXAMPLE ${BGFX_EXAMPLES} )
Expand Down
11 changes: 6 additions & 5 deletions cmake/shared.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/generated/vertexlayout.cpp.in
target_sources( bgfx-vertexlayout INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/generated/vertexlayout.cpp )
target_include_directories( bgfx-vertexlayout INTERFACE ${BGFX_DIR}/include )

add_library( bgfx-shader-spirv INTERFACE )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/generated/shader_spirv.cpp.in
${CMAKE_CURRENT_BINARY_DIR}/generated/shader_spirv.cpp )
target_sources( bgfx-shader-spirv INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/generated/shader_spirv.cpp )
target_include_directories( bgfx-shader-spirv INTERFACE ${BGFX_DIR}/include )
add_library( bgfx-shader INTERFACE )

configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/generated/shader.cpp.in
${CMAKE_CURRENT_BINARY_DIR}/generated/shader.cpp )
target_sources( bgfx-shader INTERFACE ${CMAKE_CURRENT_BINARY_DIR}/generated/shader.cpp )
target_include_directories( bgfx-shader INTERFACE ${BGFX_DIR}/include )

add_library( bgfx-bounds INTERFACE )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/generated/bounds.cpp.in
Expand Down
2 changes: 1 addition & 1 deletion cmake/tools/shaderc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ include( cmake/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" )
set_target_properties( shaderc PROPERTIES FOLDER "bgfx/tools" )
target_link_libraries(shaderc PRIVATE bx bimg bgfx-vertexlayout bgfx-shader-spirv fcpp glsl-optimizer glslang spirv-cross spirv-tools webgpu)
target_link_libraries(shaderc PRIVATE bx bimg bgfx-vertexlayout bgfx-shader fcpp glsl-optimizer glslang spirv-cross spirv-tools webgpu)

if( BGFX_CUSTOM_TARGETS )
add_dependencies( tools shaderc )
Expand Down
4 changes: 4 additions & 0 deletions generated/shader.cpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#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"
1 change: 0 additions & 1 deletion generated/shader_spirv.cpp.in

This file was deleted.

0 comments on commit 44aba91

Please sign in to comment.