mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-17 21:12:35 +01:00
Compare commits
14 Commits
v1.122.857
...
v1.127.872
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
701d84c222 | ||
|
|
5940bb7cf8 | ||
|
|
2fcbf437f2 | ||
|
|
d7f59648a8 | ||
|
|
e8db646d2c | ||
|
|
e12aba94c7 | ||
|
|
8dcc50e992 | ||
|
|
011e8efe23 | ||
|
|
871eed8f8a | ||
|
|
2f0e950b8f | ||
|
|
26af75d78b | ||
|
|
1f65bfcb44 | ||
|
|
875927a712 | ||
|
|
f46699bb4a |
@@ -38,6 +38,10 @@ 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(
|
||||
|
||||
2
bgfx
2
bgfx
Submodule bgfx updated: 98f16cd125...57d8a0838b
2
bimg
2
bimg
Submodule bimg updated: ec02df824a...e9fa0ceff2
2
bx
2
bx
Submodule bx updated: 198cd120e4...34ba9c7a5c
@@ -14,10 +14,7 @@ macro(_bgfx_crosscompile_use_host_tool TOOL_NAME)
|
||||
find_program(
|
||||
${TOOL_NAME}_EXECUTABLE
|
||||
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
|
||||
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}")
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -365,7 +365,7 @@ if(TARGET bgfx::shaderc)
|
||||
# OUTPUT filename
|
||||
# FRAGMENT|VERTEX|COMPUTE
|
||||
# ANDROID|ASM_JS|IOS|LINUX|NACL|OSX|WINDOWS
|
||||
# [PROFILE profile]
|
||||
# PROFILE profile
|
||||
# [O 0|1|2|3]
|
||||
# [VARYINGDEF filename]
|
||||
# [BIN2C filename]
|
||||
@@ -392,6 +392,8 @@ if(TARGET bgfx::shaderc)
|
||||
# -f
|
||||
if(ARG_FILE)
|
||||
list(APPEND CLI "-f" "${ARG_FILE}")
|
||||
else()
|
||||
message(SEND_ERROR "Call to _bgfx_shaderc_parse() must have an input file path specified.")
|
||||
endif()
|
||||
|
||||
# -i
|
||||
@@ -405,6 +407,8 @@ if(TARGET bgfx::shaderc)
|
||||
# -o
|
||||
if(ARG_OUTPUT)
|
||||
list(APPEND CLI "-o" "${ARG_OUTPUT}")
|
||||
else()
|
||||
message(SEND_ERROR "Call to _bgfx_shaderc_parse() must have an output file path specified.")
|
||||
endif()
|
||||
|
||||
# --bin2c
|
||||
@@ -518,6 +522,8 @@ if(TARGET bgfx::shaderc)
|
||||
# --profile
|
||||
if(ARG_PROFILE)
|
||||
list(APPEND CLI "--profile" "${ARG_PROFILE}")
|
||||
else()
|
||||
message(SEND_ERROR "Call to _bgfx_shaderc_parse() must have a shader profile.")
|
||||
endif()
|
||||
|
||||
# -O
|
||||
@@ -575,16 +581,8 @@ if(TARGET bgfx::shaderc)
|
||||
OR CYGWIN
|
||||
)
|
||||
set(PLATFORM WINDOWS)
|
||||
if(ARGS_TYPE STREQUAL "VERTEX" OR ARGS_TYPE STREQUAL "FRAGMENT")
|
||||
list(APPEND PROFILES s_3_0)
|
||||
list(APPEND PROFILES s_4_0)
|
||||
list(APPEND PROFILES s_5_0)
|
||||
elseif(ARGS_TYPE STREQUAL "COMPUTE")
|
||||
list(APPEND PROFILES s_4_0)
|
||||
list(APPEND PROFILES s_5_0)
|
||||
else()
|
||||
message(error "shaderc: Unsupported type")
|
||||
endif()
|
||||
list(APPEND PROFILES s_4_0)
|
||||
list(APPEND PROFILES s_5_0)
|
||||
else()
|
||||
message(error "shaderc: Unsupported platform")
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user