ToLua and tardis
Posted: Wed Apr 16, 2008 9:25 am
As already mentioned in the commit message, two hours of FuK are very "enlightening".
It wasn't that easy to make things go. The problem was mostly the path, which was always the root directory of the trunk when executing a process from cmake files. I was finally able to deal with it by using scripts:
tolua-build
bin/exec-tolua-script
These are called in the root CMLs to build tolua and later create the tolua_bind files.
For now it seems to work on tardis (compile at least, couldn't test yet), but there are at least 2 problems left:
- write batch files for windows boxes and write #IF (WIN32) to the CMLs
- tolua can't handle makro definition. For instance in class _CoreExport Script {}; how could tolua know that _CoreExport is a makro?
--> I had to copy Script.h to Script_clean.h
This is not a very solution frankly. But I have got an idea: we could use gcc (maybe even cmake to ensure compatibility) and its preprocessor output to create those Class_clean.h files automatically. The problem is: #include <librarfile> won't be found, but doesn't have to be --> use grep to remove alle #include lines.
However, I'm no grepper and it's not portable.
It wasn't that easy to make things go. The problem was mostly the path, which was always the root directory of the trunk when executing a process from cmake files. I was finally able to deal with it by using scripts:
tolua-build
bin/exec-tolua-script
These are called in the root CMLs to build tolua and later create the tolua_bind files.
For now it seems to work on tardis (compile at least, couldn't test yet), but there are at least 2 problems left:
- write batch files for windows boxes and write #IF (WIN32) to the CMLs
- tolua can't handle makro definition. For instance in class _CoreExport Script {}; how could tolua know that _CoreExport is a makro?
--> I had to copy Script.h to Script_clean.h
This is not a very solution frankly. But I have got an idea: we could use gcc (maybe even cmake to ensure compatibility) and its preprocessor output to create those Class_clean.h files automatically. The problem is: #include <librarfile> won't be found, but doesn't have to be --> use grep to remove alle #include lines.
However, I'm no grepper and it's not portable.