datatoc: exclude the initial C-style comment from GLSL/MSL/Cuda files

Add optional argument `STRIP_LEADING_C_COMMENTS` to CMake macros:
data_to_c_simple & data_to_c.

Strip leading C-style comments that don't bloat binary size.
Comments are replaced with blank lines so line numbers in error messages
match. Reduces Blender's binary size by ~70kb.
This commit is contained in:
Campbell Barton
2023-08-19 17:56:50 +10:00
parent 63c1a26069
commit 20b4a77872
8 changed files with 169 additions and 12 deletions

View File

@@ -87,7 +87,11 @@ if(WITH_OPENSUBDIV)
add_definitions(-D_USE_MATH_DEFINES)
endif()
data_to_c_simple(internal/evaluator/shaders/glsl_compute_kernel.glsl SRC)
data_to_c_simple(
internal/evaluator/shaders/glsl_compute_kernel.glsl
SRC
STRIP_LEADING_C_COMMENTS
)
else()
list(APPEND SRC
stub/opensubdiv_stub.cc