Page 1 of 1

[Compiler Request] Make the compiler use the IDE options

Posted: Mon Apr 27, 2009 9:29 pm
by mback2k
It would be great if the compiler could parse the IDE options inside the source file. Maybe using a new compiler switch like /IDEOPTIONS ?

Would make it a lot easier to switch between batch and IDE compiling.

Re: [Compiler Request] Make the compiler use the IDE options

Posted: Sun Apr 04, 2010 6:43 pm
by mback2k
Since we have projects now it would be cool if either the IDE or compiler could compile project targets from the commandline.

Re: [Compiler Request] Make the compiler use the IDE options

Posted: Fri Jun 11, 2010 12:21 pm
by luis
mback2k wrote:Since we have projects now it would be cool if either the IDE or compiler could compile project targets from the commandline.
I totally agree.

Re: [Compiler Request] Make the compiler use the IDE options

Posted: Thu Nov 07, 2013 1:05 pm
by infratec
I just run into the same problem:

we have a projekt with one zentral program which starts other programs.
All programs are written in PB and shares at least 2 pbi files.
So if something is changed in one of these 2 files we have to compile all pb files.

For that I wrote a batch file and ...

I have to add for each different file several different options like
/exe .. /icon ... and for some /thread

It would really a lot easier if there is a parameter that the compiler uses the info from inside of the file.

For now I'm writing a PB program which scans the files, creates the batchfile and run it.

Bernd

Re: [Compiler Request] Make the compiler use the IDE options

Posted: Thu Nov 07, 2013 1:15 pm
by Shield
mback2k wrote:Since we have projects now it would be cool if either the IDE or compiler could compile project targets from the commandline.
+1, I was about to make that feature request too! :)

Re: [Compiler Request] Make the compiler use the IDE options

Posted: Thu Nov 07, 2013 2:13 pm
by Fred
The IDE can build projects/target from commandline: http://www.purebasic.com/documentation/ ... dline.html

Re: [Compiler Request] Make the compiler use the IDE options

Posted: Thu Nov 07, 2013 2:33 pm
by Shield
Oh wow, how did I miss that... :shock:

Re: [Compiler Request] Make the compiler use the IDE options

Posted: Thu Nov 07, 2013 7:58 pm
by skywalk
I would still prefer the pbcompiler use the data within the source code.
It seems more direct and I don't have to bother with the xml project files or resource files.
Is the IDE code to read in the version info not easily added to the pbcompiler.exe?

This works but I lose all version info in my dll or exe. :cry:

Code: Select all

c:\Program Files\PureBasic\Compilers>pbcompiler c:\myproj\myapp.pbi /EXE c:\myproj\myapp.dll /DLL
For now, I run a tool from the IDE but this requires more clicks.

Re: [Compiler Request] Make the compiler use the IDE options

Posted: Fri Nov 08, 2013 11:21 am
by PB
> I would still prefer the pbcompiler use the data within the source code

Yes, it'd be good to have commands like "EnableThreadSafety" so we
don't need to set it in the options. Even on these forums, people post
code samples and have to put comments to remind us to enable thread
safety and so on. If it were a command, it would just work. :)

Re: [Compiler Request] Make the compiler use the IDE options

Posted: Fri Nov 08, 2013 11:37 am
by Fred
This one is not possible to set in the code, as it's a global switch (it uses different code generation). You can put a check with CompilerIf #PB_Compiler_ThreadSafe = 0 and CompilerError to force that.

Re: [Compiler Request] Make the compiler use the IDE options

Posted: Fri Nov 08, 2013 8:52 pm
by mback2k
Regarding the original feature request: It would still be great to have a console-type application that is able to compile using project files. The problem with using the IDE is that it opens a new console window if you run it from within a console shell.