Compiling Lua Project from Source

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
pwniknoobz
Prole
Posts: 11
Joined: Fri Jul 16, 2010 3:10 pm

Compiling Lua Project from Source

Post by pwniknoobz »

I would like to extend the Love2D engine with my own functions in c++. What would the process be to compile/run a Love2d project from the source code. Just load all source files into a project in their native directory structure and somehow include love.cpp in my main lua file? Would I have to do something with Makefile.am or Makefile.in?

Thanks in advance!
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Compiling Lua Project from Source

Post by Robin »

Nope.

You'd have to have a custom build of LÖVE, which is something I don't recommend, because then no-one but you can play it.*

love.native used to offer something like this, but that module was shot after it turned out it couldn't be done in a completely cross-platform manner.

* I know, unless you distribute the modified engine. Shuddup.
Help us help you: attach a .love.
pwniknoobz
Prole
Posts: 11
Joined: Fri Jul 16, 2010 3:10 pm

Re: Compiling Lua Project from Source

Post by pwniknoobz »

Unless you distribute the modif....oh.

Got it, that makes sense. Is it possible for me to compile my own modified version of the engine from the source to accomplish this?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Compiling Lua Project from Source

Post by Robin »

pwniknoobz wrote: Is it possible for me to compile my own modified version of the engine from the source to accomplish this?
Yes... but then everyone who plays the game has to have the modified version, which means that you lose a large number of potential gamers, especially within the community.
Help us help you: attach a .love.
pwniknoobz
Prole
Posts: 11
Joined: Fri Jul 16, 2010 3:10 pm

Re: Compiling Lua Project from Source

Post by pwniknoobz »

Would the process to do that be as I descried in the original post - include all Love2d source files in their native directory structure and somehow require love.cpp in the lua file?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Compiling Lua Project from Source

Post by Robin »

pwniknoobz wrote:Would the process to do that be as I descried in the original post - include all Love2d source files in their native directory structure and somehow require love.cpp in the lua file?
Nope. LÖVE can't compile itself. ;)

You just modify the source code, compile it, and do your thing.
Help us help you: attach a .love.
pwniknoobz
Prole
Posts: 11
Joined: Fri Jul 16, 2010 3:10 pm

Re: Compiling Lua Project from Source

Post by pwniknoobz »

Got ya - So I just compile/create a new Love.exe to run my love programs in?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Compiling Lua Project from Source

Post by Robin »

If you really need it, then yes.

Keep in mind that it means you can't rely on this community any more if you do that.
Help us help you: attach a .love.
User avatar
Luiji
Party member
Posts: 396
Joined: Mon May 17, 2010 6:59 pm

Re: Compiling Lua Project from Source

Post by Luiji »

Yeah, I highly recommend you instead try contributing code to the official LOVE repository.

Along with that, you could always create an external library then import it from Lua.
Good bye.
User avatar
Elvashi
Prole
Posts: 45
Joined: Sat Jul 04, 2009 9:17 am
Location: Australia

Re: Compiling Lua Project from Source

Post by Elvashi »

Luiji wrote:Along with that, you could always create an external library then import it from Lua.
That wouldn't really offer much improvement, you still need to ship the binary module with your game (and they can't be placed in lovechives, nor should they.), and you'd still have to provide versions for every platform you intend your game to be playable on.
You'd pretty much forfeit uLove compliance as well.
Luiji wrote:Yeah, I highly recommend you instead try contributing code to the official LOVE repository.
Which brings us back to this. If you really have something you think love lacks, then you should try contributing patches.
"We could make a program for doing this for you, but that is for the LÖVE IDE, planned to be released in March 2142." ~mike
Networking with UDP uLove Proposal CCG: Gangrene
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 204 guests