#Export a symbol from a non-root file

1 messages · Page 1 of 1 (latest)

frank saffron
#

When I export a function in a module that I've @imported, code isn't getting generated. I think the problem is that the declarations aren't referenced: I need to add comptime { _ = themodule.exported_function }. Is there any way to avoid that?

odd ruin
frank saffron
#

yup

odd ruin
#

so even @importing something will not get compiled if you don't use anything from it

frank saffron
#

Is comptime { thatmodule } the only workaround? Can't I do anything from the build script?

odd ruin
#

i do not think there's a way around it, other than forcing it at comptime

frank saffron
#

:( k

solar trail
frank saffron
#

yup. trying to develop teaching resources so needing to introduce those semantics is quite a drawback. I think I'll rework my build process to build two roots and link them

frank saffron
#

ah. theres a special case I can use for compiler_rt