Fix shader files search

This commit is contained in:
halx99 2023-07-22 23:58:52 +08:00
parent 0d4a274d41
commit 9770aaa812
2 changed files with 7 additions and 6 deletions

View File

@ -391,10 +391,11 @@ function(ax_setup_app_config app_name)
ax_find_shaders(${app_shaders_dir} app_shaders RECURSE)
if (app_shaders)
list(LENGTH ${app_shaders} app_shaders_count)
message(STATUS "${app_shaders_count} found in ${app_shaders_dir}")
list(LENGTH app_shaders app_shaders_count)
message(STATUS "${app_shaders_count} shader sources found in ${app_shaders_dir}")
# compile app shader to ${CMAKE_BINARY_DIR}/runtime/axslc/custom/
ax_target_compile_shaders(${app_name} FILES ${app_shaders} CUSTOM)
ax_target_compile_shaders(${app_name} FILES ${app_shaders} CUSTOM)
source_group("Source Files/Source/shaders" FILES ${app_shaders})
else()
message(STATUS "No shader found in ${app_shaders_dir}")
endif()

View File

@ -5,12 +5,12 @@ cmake_policy(SET CMP0057 NEW)
## enable shader lang by shader compiler: glslcc
macro(glslcc_option variable value)
if(NOT DEFINED ${variable})
set(${variable} ${value} CACHE STRING "" FORCE)
set(${variable} ${value} CACHE STATIC "" FORCE)
endif()
endmacro()
glslcc_option(GLSLCC_FRAG_SOURCE_FILE_EXTENSIONS .frag;.fsh)
glslcc_option(GLSLCC_VERT_SOURCE_FILE_EXTENSIONS .vert;.vsh)
glslcc_option(GLSLCC_FRAG_SOURCE_FILE_EXTENSIONS ".frag;.fsh")
glslcc_option(GLSLCC_VERT_SOURCE_FILE_EXTENSIONS ".vert;.vsh")
glslcc_option(GLSLCC_OUT_DIR ${CMAKE_BINARY_DIR}/runtime/axslc)
glslcc_option(GLSLCC_FIND_PROG_ROOT "")