Add new 'opts' attribute to shader_binary() rule AND allow .h files in 'srcs' attribute to be #include-d#44
Add new 'opts' attribute to shader_binary() rule AND allow .h files in 'srcs' attribute to be #include-d#44tintor wants to merge 1 commit intozaucy:mainfrom
Conversation
…n 'srcs' attribute to be #include-d Enables sharing of code and definitions between shaders and C/C++ code. Enables setting optimization level (-O) and setting defines (-D) from bazel.
| incdirs_dict[parent_dir] = True | ||
| incdirs_list = [] | ||
| for d in sorted(incdirs_dict.keys()): | ||
| incdirs_list.append("-I" + d) |
There was a problem hiding this comment.
I don't think having every source file parent path as an include directory for every file is very expected, no?
Does glslc not already find headers relative to the source files?
| default = '', | ||
| values = [''] + _shader_stages, | ||
| ), | ||
| "opts": attr.string_list(default = []), |
There was a problem hiding this comment.
instead of a general opts could we emulate what the cc_* libraries do and have a defines attribute for defines etc? https://bazel.build/reference/be/c-cpp#cc_library.defines
understand this desire! However these should be controlled by bazels compilation option ( |
Enables sharing of code and definitions between shaders and C/C++ code.
Enables setting optimization level (-O) and setting defines (-D) from bazel.