Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Premake4 utility and application entry point

I use premake4.exe utility for generate project files for different platforms. The problem is that I could not find how to specify custom application entry point in lua-config file.

Which option should I use? For example, in Visual Studio I can go to

Project Properties->Linker->Advanced
Entry Point  = name_of_my_entry_point_function

In premake4 manual (http://industriousone.com/flags) I found only WinMain() flag that determinate WinMain function as application entry point, but I need custom entry point for example like a wmain().

like image 993
Russian Bear Avatar asked Mar 25 '26 18:03

Russian Bear


1 Answers

There is no field to specify a custom entrypoint in Premake4. Indeed, I'm not sure that GCC even allows a custom entrypoint, so it would be platform-specific.

But, since you're being platform-specific, you can always just specify additional command-line arguments. For example:

configuration { "vc2008" }
  linkoptions { "/ENTRY:<function name here>" }

BTW, it should be noted that the MSDN docs for this seem to suggest that using it will not properly initialize global static objects. So use this with care. For more information, see What is the difference between main and mainCRTStartup?

like image 56
Nicol Bolas Avatar answered Mar 28 '26 06:03

Nicol Bolas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!