Open awr1 opened 4 years ago
Also I find it curious is why g++ is getting shelled-out even though it should be calling the C compiler.
while i was working on #12144 I noticed why this is the case:
if c.config.cmd == cmdCompileToC:
let m = s.getModule()
incl(m.flags, sfCompileToCpp)
incl c.config.globalOptions, optMixedMode
however the logic seems buggy currently and might explain undefined reference to
systemDatInit000()` : see my note in https://github.com/nim-lang/Nim/pull/12144#issuecomment-528656549 hopefully it explains what's going on.
To make this all work (including supporting exportcpp
with nim c
), the correct fix would involve making sure all the cgen.requiresExternC
calls are made after all calls to processImportCpp
in a given module, so that sfCompileToCpp
takes effect consistently for all declarations in that module
This runs correctly in
cpp
mode, but doesn't incc
mode, which is to be expected, but the error is not straightforward:Also I find it curious is why
g++
is getting shelled-out even though it should be calling the C compiler.