Don't fail if installed from build without tools

This commit is contained in:
Sandy Carter
2023-07-14 13:01:09 -04:00
committed by Sandy
parent a1a7828ab0
commit b3dae62c95
3 changed files with 633 additions and 617 deletions

View File

@@ -13,7 +13,7 @@ if(@CMAKE_CROSSCOMPILING@)
macro(_bgfx_crosscompile_use_host_tool TOOL_NAME)
if(NOT TARGET bgfx::${TOOL_NAME})
find_program(
${TOOL_NAME}_EXECUTABLE REQUIRED
${TOOL_NAME}_EXECUTABLE
NAMES bgfx-${TOOL_NAME} ${TOOL_NAME}
PATHS /usr/bin #
${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/packages/bgfx_x64-linux/tools/bgfx

View File

@@ -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)

View File

@@ -1,3 +1,6 @@
# If bgfx.cmake was compiled without tools or cross compiled without host having tools,
# then don't provide helper functions
if(TARGET bgfx::bin2c)
# _bgfx_bin2c_parse(
# INPUT_FILE filename
# OUTPUT_FILE filename
@@ -58,7 +61,11 @@ function(bgfx_compile_binary_to_header)
MAIN_DEPENDENCY ${ARG_INPUT_FILE} #
)
endfunction()
endif()
# If bgfx.cmake was compiled without tools or cross compiled without host having tools,
# then don't provide helper functions
if(TARGET bgfx::texturec)
# _bgfx_texturec_parse(
# FILE filename
# OUTPUT filename
@@ -211,7 +218,11 @@ function(bgfx_compile_texture)
MAIN_DEPENDENCY ${ARG_INPUT} #
)
endfunction()
endif()
# If bgfx.cmake was compiled without tools or cross compiled without host having tools,
# then don't provide helper functions
if(TARGET bgfx::geometryc)
# _bgfx_geometryc_parse(
# FILE filename
# OUTPUT filename
@@ -344,7 +355,11 @@ function(bgfx_compile_geometry)
MAIN_DEPENDENCY ${ARG_INPUT} #
)
endfunction()
endif()
# If bgfx.cmake was compiled without tools or cross compiled without host having tools,
# then don't provide helper functions
if(TARGET bgfx::shaderc)
# _bgfx_shaderc_parse(
# FILE filename
# OUTPUT filename
@@ -619,3 +634,4 @@ function(bgfx_compile_shader_to_header)
set(${ARGS_OUT_FILES_VAR} ${ALL_OUTPUTS} PARENT_SCOPE)
endif()
endfunction()
endif()