Kode/kincmake

build directory is fixed for shader compiles

Closed this issue · 7 comments

kincmake allows setting a custom build directory using the --to option. It seems that the shader compile part expects the build directory to be called "build" regardless of the --to setting. This makes --to unusable it seems.

These two lines are the main culprit I think (out/make.js in function exportKoremakeProject()):

project.addFile('build/Sources/*', {});
await compileShader(from, shaderLang(platform), file.file, path.join(project.getDebugDir(), outfile), 'build', platform, 'build');

Example:

C:\Project>node Kinc\make.js -g direct3d11 -v vs2017 --arch x86 --to build_direct3d11 --kincfile kincfile_direct3d11.js
kincfile found.
Creating Windows project files.
Compiling shader 1 of 10 (g1.frag).
Error: unable to open input file: C:\Project\build\g1.frag.hlsl

Shader compiler error.

I can confirm changing the line:

await compileShader(from, shaderLang(platform), file.file, path.join(project.getDebugDir(), outfile), 'build', platform, 'build');

To:

await compileShader(from, shaderLang(platform), file.file, path.join(project.getDebugDir(), outfile), options.to, platform, options.to);

Fixed the issue on Windows:

C:\Project>node Kinc\make.js -g direct3d11 -v vs2017 --arch x86 --to build_direct3d11 --kincfile 
kincfile_direct3d11.js
kincfile found.
Creating Windows project files.
Compiling shader 1 of 10 (g1.frag).
Compiling shader 2 of 10 (g1.vert).
Compiling shader 3 of 10 (painter-colored.frag).
Compiling shader 4 of 10 (painter-colored.vert).
Compiling shader 5 of 10 (painter-image.frag).
Compiling shader 6 of 10 (painter-image.vert).
Compiling shader 7 of 10 (painter-text.frag).
Compiling shader 8 of 10 (painter-text.vert).
Compiling shader 9 of 10 (painter-video.frag).
Compiling shader 10 of 10 (painter-video.vert).

Send a pull request please. But change the typescript file, not the compiled javascript file.

Unfortunately I will have to leave that to someone who is familiar with Typescript and has it installed.

Oh, no problem, I'll teach you all you have to know about TypeScript in 15 seconds: It's JavaScript plus type annotations. You have to do the exact same change you did to the JavaScript file.

Okay, no biggie, I thought you'd be interested to know about a bug in your project. It's not worth my time to install Typescript, compile, and prepare a pull request. As that interest doesn't appear to be there I have closed the issue.

BTW. thanks for your work on Kore/Kinc, it's been very useful.

Okidoki, I'll keep in mind that it's not worth my time to provide any support to you either.

Do people expect support from Open Source authors? I thought the whole point of OS was you get what you get.

Anyway, I'm not trying to annoy you. I really just wanted to report a bug. Are bug reports not something a programmer wants to receive?