Home » Developing U++ » U++ Developers corner » Ideas on U++ as library
Ideas on U++ as library [message #45645] |
Fri, 18 December 2015 14:40 |
|
Moving this discussion here, so I don't hijack original discussion about PR.
mirek wrote on Fri, 18 December 2015 11:01dolik.rce wrote on Thu, 17 December 2015 21:08
I remember some experiments with converting upp files to Visual Studio projects, waf based builds and of course the universal makefile, but frankly, all of those are quite difficult to use without previous knowledge of U++. Making a library that could be just linked against would help a lot, but I know this has already been tried several times before, with mixed results.
Well, I am afraid this is still mostly the question of INITBLOCK.
Should we drop INITBLOCK and require manual registration of modules used?
Mirek
Do you mean that INITBLOCKs cause trouble with building icpp files or that they are not called in library? I believe the first issue is more or less solved, so I'll assume the second is what you meant. Correct me if I'm mistaken.
I haven't really think any of this through, but here are some ideas:
1) Some script during library build goes through all code and gathers INITBLOCKs, then generates code that executes them in init function/DllMain. It might require some changes to how INITBLOCK macro is defined when building as library, but that should be simple.
2) Ignore INITBLOCKs when building library and allow manual registration of everything the user needs. This would require good documentation of what can registered When using static linking, everything could still work as of now.
3) Putting all INITBLOCKs content into separate header files. It would then be users responsibility to include necessary headers exactly once into an application. This would make the manual initialization quite simple (one include per package) and it would also simplify compilation - you'd just need to special handle one file that includes all the initialization headers, instead of all icpp files.
Any other ideas are welcome If I have some spare time during holidays, I'll try to experiment with this a bit.
Having a dynamic library would lower the barrier for newbies significantly. I believe many leave U++ before trying it because a) it seems to be slow, when building everything for the first time or b) it requires static linking.
Honza
|
|
|
Goto Forum:
Current Time: Sat May 11 15:31:22 CEST 2024
Total time taken to generate the page: 0.01573 seconds
|