Open pezcode opened 2 hours ago
I think compatibility with it is fairly important
Yes.
but the official one has a few advantages and works well these days
:cry: Anything else I could add to mine, apart from the bloated load of automagic crap that's there?
remove the special handling from UseCorrade.cmake. Might break for some users who rarely update their toolchains.
I'm for this option. Toolchains breakage is fine, it breaks every second Emscripten update anyway. Plus, in many cases people are using a toolchain from within a Corrade submodule, so they get the update implicitly.
Additionally, if you're willing to make a PR for this, you could attempt to do the same treatment for the corrade-rc
binary. It's been on my TODO list for a while, to not require an external build of it if CMAKE_CROSSCOMPILING_EMULATOR
is set. Related is also https://github.com/mosra/corrade/issues/81.
Actually, I think the right solution is implementing both options. Especially in combination with corrade-rc
being run through Node.js, which is anything but fast.
So, in particular:
if(NOT CMAKE_CROSSCOMPILING_EMULATOR)
to UseCorrade.cmake
so it still works with older toolchains, or when one explicitly disables that. For example, it should be possible to compile for Emscripten even without having that damn bloaty thing installed, and thus CMAKE_CROSSCOMPILING_EMULATOR
may not be set at all.corrade-rc
built and used if CMAKE_CROSSCOMPILING_EMULATOR
is set and if CORRADE_RC_EXECUTABLE
is not present (or it's not found). I.e., prefer the native version when possible, to not make #94 even worse than it is with large files.CMAKE_CROSSCOMPILING_EMULATOR
if found. CMAKE_DISABLE_FIND_PACKAGE_NodeJs
should work in this case and do the expected thing.
When
CMAKE_CROSSCOMPILING_EMULATOR
is set to the path to nodejs,corrade_add_test()
finds and prepends nodejs a second time manually toadd_test()
. This leads to node trying to load its own binary and failing:Not sure what "the" correct solution is here. What came to my mind:
CMAKE_CROSSCOMPILING_EMULATOR
in Corrade's toolchain and remove the special handling from UseCorrade.cmake. Might break for some users who rarely update their toolchains.if(NOT CMAKE_CROSSCOMPILING_EMULATOR)
, a bit ugly but it should workThe official Emscripten toolchain file sets
CMAKE_CROSSCOMPILING_EMULATOR
, I think compatibility with it is fairly important. We've been using the Corrade toolchain, but the official one has a few advantages and works well these days, so we'd prefer to use that.