ncsoft / Unreal.js-core

Unreal.js plugin submodule
Other
260 stars 117 forks source link

Linux Compilation Errors #55

Closed thejustinwalsh closed 4 years ago

thejustinwalsh commented 4 years ago

As of Unreal 4.21 you must explicitly declare your PCH file, and as of 4.24 you need to configure a few flags in the modules build.cs in order to use PCH files as well as suppress shadow variable warnings. This commit includes those changes to the V8.Build.cs to ensure that the V8PCH.h file is used when compiling the V8 module.

Additionally, I was unable to suppress the -Wunused-return warning as error so changes where made to store the return value in those cases.

Finally, FExportedStructMemoryInfo would throw an error detailing how the copy constructor was deleted, so I removed the attempt to default it. It appears as if the Global context in v8 is a move only type so removing the copy constructor suppress the error.

Until issue #53 is resolved I am unable to link, however all of these changes allow me to compile on Linux against 4.24.1.

crocuis commented 4 years ago

Is there a reason why it is necessary to declare an unused variable?

thejustinwalsh commented 4 years ago

On Linux when compiling with the bundled clang toolset unused-return warnings return as errors. UE4 doesn't provide a macro for unused-return and I did not want to sprinkle in clang specific pragmas to suppress it. What would be the preferred solution here. Without ret0, ret1, amd ret, the source code fails to compile.

crocuis commented 4 years ago

http://releases.llvm.org/9.0.0/tools/clang/docs/DiagnosticsReference.html#wunused-result Is this correct?

crocuis commented 4 years ago

Fixed.

thejustinwalsh commented 4 years ago

The link above is indeed that warning / error I was seeing. Thanks!