[Compiler Request] Make the compiler use the IDE options

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
mback2k
Enthusiast
Enthusiast
Posts: 257
Joined: Sun Dec 02, 2007 12:11 pm
Location: Germany

[Compiler Request] Make the compiler use the IDE options

Post 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.
User avatar
mback2k
Enthusiast
Enthusiast
Posts: 257
Joined: Sun Dec 02, 2007 12:11 pm
Location: Germany

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

Post by mback2k »

Since we have projects now it would be cool if either the IDE or compiler could compile project targets from the commandline.
User avatar
luis
Addict
Addict
Posts: 3893
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

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

Post 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.
"Have you tried turning it off and on again ?"
A little PureBasic review
infratec
Always Here
Always Here
Posts: 7575
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

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

Post 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
Last edited by infratec on Thu Nov 07, 2013 1:43 pm, edited 1 time in total.
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

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

Post 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! :)
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
Fred
Administrator
Administrator
Posts: 18153
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

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

Post by Fred »

The IDE can build projects/target from commandline: http://www.purebasic.com/documentation/ ... dline.html
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

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

Post by Shield »

Oh wow, how did I miss that... :shock:
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
User avatar
skywalk
Addict
Addict
Posts: 4210
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

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

Post 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.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

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

Post 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. :)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Fred
Administrator
Administrator
Posts: 18153
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

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

Post 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.
User avatar
mback2k
Enthusiast
Enthusiast
Posts: 257
Joined: Sun Dec 02, 2007 12:11 pm
Location: Germany

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

Post 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.
Post Reply