jlaumon / AssetCooker

Asset Cooker is a build system aimed at game assets, for custom engines. It leverages Windows' USN journals to robustly track which files change, and only cook what needs to be cooked.
Mozilla Public License 2.0
219 stars 6 forks source link

Build fix for unknown char in minilua.h #1

Closed jagt closed 1 week ago

jagt commented 1 week ago

Weird error on my box. This should've fixed it.

Thanks a ton for this, this is like exactly what I was expecting and it's even better :)

jlaumon commented 1 week ago

Thanks for the PR!

Would it work to disable this warning only for LuaReader.cpp? (which includes minilua's implementation)

Otherwise that's fine as a workaround but it'd be nice to also do PR for minilua.

jlaumon commented 1 week ago

If can post the exact warning you get I can also take a look at doing the PR for minilua

jagt commented 1 week ago

See below:

1>D:\Dev1\AssetCooker\thirdparty\minilua\minilua.h(28341,1): error C2220: the following warning is treated as an error (compiling source file src\LuaReader.cpp)
1>D:\Dev1\AssetCooker\thirdparty\minilua\minilua.h(28341,1): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss (compiling source file src\LuaReader.cpp)
1>D:\Dev1\AssetCooker\thirdparty\minilua\minilua.h(28341,1): error C2220: the following warning is treated as an error (compiling source file src\RuleReader.cpp)
1>D:\Dev1\AssetCooker\thirdparty\minilua\minilua.h(28341,1): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss (compiling source file src\RuleReader.cpp)

Also I messed up my branch, let me fix it

jlaumon commented 1 week ago

I don't really understand why you get this warning. There is no weird character on line 28341 that I can see.

What happens if you try adding buildoptions { "/utf-8" } instead if the warning? (You can add it just after the disablewarnings block). That should make the compiler consider all files to be utf-8 instead of code page (936).

jagt commented 1 week ago

Actually it's pretty confusing to me. I suspect it's too long and the char is somewhere else. I suspect that it's my windows is localized.

/utf-8 works for me. I've updated the commit. Thanks!