How to build my GText generated c++?
As some may have noticed from my earlier posts I'm making a self-contained language that generates to cxx using GText.
I'm getting to the point where I'd like to set up the build system for it so I can see if all the code I'm generating actually compiles w/o manually copying things around or whatever.
I did a bit of looking around and see the buildLanguage and read the user guide section on it, and I think it will work for me though I'm not entirely sure how.
The user guide talks about how to make a stand-alone buildLanguage thing that echoes "Hello World", but I'm not sure how I should set it up to build a solution that uses my new language. Do I make a generator somewhere that goes from a model in my language and generates a buildLanguage project and somehow make it go? I'm just not really sure where to start here. If I get pointed in the right general direction I can probably figure out the details.
Also: I think I should file a bug on this, but as long as I'm posting here: I followed along with the buildLanguage user guide and created a simple "echo Hello World" task (BuildTest.zip (12KB)), but I get "Buildfile: build.xml does not exist!" when I try to run it. Am I doing something wrong or should I file a bug?
If I can't get this to work from w/in MPS I see you can generate from w/in an ant script so I might make an ant script outside of MPS that does the building, but that wouldn't demo as well :).
Thanks!
I'm getting to the point where I'd like to set up the build system for it so I can see if all the code I'm generating actually compiles w/o manually copying things around or whatever.
I did a bit of looking around and see the buildLanguage and read the user guide section on it, and I think it will work for me though I'm not entirely sure how.
The user guide talks about how to make a stand-alone buildLanguage thing that echoes "Hello World", but I'm not sure how I should set it up to build a solution that uses my new language. Do I make a generator somewhere that goes from a model in my language and generates a buildLanguage project and somehow make it go? I'm just not really sure where to start here. If I get pointed in the right general direction I can probably figure out the details.
Also: I think I should file a bug on this, but as long as I'm posting here: I followed along with the buildLanguage user guide and created a simple "echo Hello World" task (BuildTest.zip (12KB)), but I get "Buildfile: build.xml does not exist!" when I try to run it. Am I doing something wrong or should I file a bug?
If I can't get this to work from w/in MPS I see you can generate from w/in an ant script so I might make an ant script outside of MPS that does the building, but that wouldn't demo as well :).
Thanks!
Please sign in to leave a comment.
1. Allow developer to make/run cxx code in MPS IDE.
2. Allow creating "makefile" to build redistributable package.
buildLanguage is about the later one. It generates ANT script, which may not be the best choice for non-java language. You can use it though. I would create a separate "makefile"-like language.
If you need to participate in MPS make process (i.e. when you press Ctrl-F9), you should create a so-called facet in plugin aspect of your language. Facets is a general way to plug-in more steps into make. Default facets are Generate, TextGen and Make (`the end of make marker`). In your case you probably want to add a Compile step. Look at 'JavaCompile' facet, declared in baseLanguage as an example.
1. create facet CxxCompile, Required facets: TextGen, Make
2. add target "compile", which will be executed "after textGen", but "before make"
3. start external process to compile/store files; report progress
4. report created files (make deletes all unreported files at the end)
Thanks!
edit: I was actually completely ignoring the ignore button in the build errors dialog, had honestly never realized it was there, of course I could have used the ignore button :)