IDE Options for platform independent development

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Lebostein
Addict
Addict
Posts: 826
Joined: Fri Jun 11, 2004 7:07 am

IDE Options for platform independent development

Post by Lebostein »

Hi,

If I change between Windows and Mac for example, I have problems with executable names and icons. At the Moment, only one name and one icon are saved:

Code: Select all

; UseIcon = Writer.ico
; Executable = Writer.exe
or

Code: Select all

; UseIcon = Icons.icns
; Executable = Writer.app
Is it possible to save this in a way like this:

Code: Select all

; UseIcon = Writer.ico
; Executable = Writer.exe
; UseIcon_mac = Icons.icns
; Executable_mac = Writer.app
That would be awesome!
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: IDE Options for platform independent development

Post by Mistrel »

You can "attempt" to create platform dependent build scripts since the compiler supports /ICON. But command line compiling and portable compiling in general isn't well supported.

What we really need are relative paths for XInclude/Include, command line /INCLUDE search paths, and support for environment variables in XInclude/Include. Then it would be possible to easily automate cross platform compilation through a shell.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: IDE Options for platform independent development

Post by freak »

Mistrel wrote:You can "attempt" to create platform dependent build scripts since the compiler supports /ICON. But command line compiling and portable compiling in general isn't well supported.
This is not true. The IDE is compiled from a single makefile on all platforms. I don't see where the problem is really.
Mistrel wrote:What we really need are relative paths for XInclude/Include, command line /INCLUDE search paths, and support for environment variables in XInclude/Include. Then it would be possible to easily automate cross platform compilation through a shell.
Name a compiled language that expands environment variables in its include statements.

Btw, you can define constants from the commandline or compiler options using environment variables, and you can use these constants in include statements. So this is already possible in PB.
quidquid Latine dictum sit altum videtur
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: IDE Options for platform independent development

Post by Mistrel »

freak wrote:Name a compiled language that expands environment variables in its include statements.
Any C/C++/Java compiler supports command line source search paths which can be used with environment variables so technically most command line compilers support this already. My suggestion of adding it to the IDE was hypothetical since there is no sane way to implement this behavior.

Without /INCLUDE there is no point compiling from the command line at all. There is no support for customizing the project environment. All paths are either absolute or relative to the project file. It's not possible to split up a project in any coherent manner.

Having no reliable way to include relative to an individual source file is backwards.

See here:
http://www.purebasic.fr/english/viewtop ... =3&t=43921
http://www.purebasic.fr/english/viewtop ... =4&t=44177
http://www.purebasic.fr/english/viewtop ... 13&t=35288
http://www.purebasic.fr/english/viewtopic.php?t=30504
freak wrote:You can define constants from the commandline or compiler options using environment variables, and you can use these constants in include statements. So this is already possible in PB.
This is also backwards. Sure, this would certainly simulate a similar behavior but now the project has an additional dependency on these constants within each file it's used. What if I want to change the constant's name? I would have to update every source file individually. And if one particular file is used across multiple projects then all of those projects would have to be updated.

/INCLUDE allows "one" dependency in the project file. Not a gazillion dependencies across who knows how many projects with how many sources. It's a big difference.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: IDE Options for platform independent development

Post by freak »

If it is all so wrong and backwards, why are you the first guy who has a problem with it?

Don't get me wrong, I think your request makes sense. But its not everything backwards and broken just because you have run into a specific problem just now.
quidquid Latine dictum sit altum videtur
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: IDE Options for platform independent development

Post by Mistrel »

If it is all so wrong and backwards, why are you the first guy who has a problem with it?
It's probably because I'm the only person here who has to deal with his include paths being so long he can barely compile at all because of recursive includes:

http://www.purebasic.fr/english/viewtop ... =3&t=43921

Considering that my largest workspace includes over a 200 PureBasic files across a dozen interdependent projects, I'm pretty fanatical about how I handle my includes.

I'm frustrated by the fact that as much as I love the PureBasic IDE, it's a lot easier to automate cross-project build dependencies and tests from the command line. It's also a terrific sanity check to ensure that the entire workspace is up to date.
But its not everything backwards and broken just because you have run into a specific problem just now.
Your suggestion for a command line constant, while a novel idea, is a backwards approach. And this "specific problem" that I am experiencing "just now" is something that I posted about years ago. It has also been requested as far back as 2005:

http://www.purebasic.fr/english/viewtop ... f=3&t=8119

I'm only being especially vocal about it now because I can only compile my project from a root path instead of across a network and I'm having to rename my files and folders to help mitigate the length of my includes.

There are some features I would really like PureBasic to have but this one (relative includes) is making my every day experience extremely unpleasant.

Here is an example of what my command line output looks like when I compile a PureBasic project. These paths aren't even legible:

Code: Select all

$ sh build.sh
Building PureGDK_Upgrade-2.0b-1.exe..

******************************************
PureBasic 4.51 (Windows - x86)
******************************************

Compiling ./prj.Installer.pb
Loading external libraries...
Starting compilation...
Including source: ./prj.Installer.pb\..\h.Installer.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.WebGadget.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.WebGadget.pb\..\h.StringField.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.WebGadget.pb\..\h.StringField.pb\..\lib.StringField.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.WebGadget.pb\..\lib.WebGadget.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.Wizard.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.Wizard.pb\..\h.Controller.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.Wizard.pb\..\h.Controller.pb\..\lib.Controller.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.Wizard.pb\..\h.GetUniquePath.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.Wizard.pb\..\h.GetUniquePath.pb\..\lib.GetUniquePath.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.Wizard.pb\..\lib.Wizard.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.FlashWindow.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.FlashWindow.pb\..\lib.FlashWindow.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_CompileExecutable.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_CompileExecutable.pb\..\..\h.Window.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_CompileExecutable.pb\..\..\h.Window.pb\..\h.InterlockedCompareExchange.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_CompileExecutable.pb\..\..\h.Window.pb\..\h.InterlockedCompareExchange.pb\..\l
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_CompileExecutable.pb\..\..\h.Window.pb\..\h.Malloc.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_CompileExecutable.pb\..\..\h.Window.pb\..\h.Malloc.pb\..\lib.Malloc.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_CompileExecutable.pb\..\..\h.Window.pb\..\lib.Window.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_CompileExecutable.pb\..\lib.DBP_CompileExecutable.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_CopyCompilerFolder.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_CopyCompilerFolder.pb\..\lib.DBP_CopyCompilerFolder.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_GetPath.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_GetPath.pb\..\..\h.Registry.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_GetPath.pb\..\..\h.Registry.pb\..\lib.Registry.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_GetPath.pb\..\..\h.GetFullPathName.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_GetPath.pb\..\..\h.GetFullPathName.pb\..\lib.GetFullPathName.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_GetPath.pb\..\..\h.GetLongPathName.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_GetPath.pb\..\..\h.GetLongPathName.pb\..\lib.GetLongPathName.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_GetPath.pb\..\lib.DBP_GetPath.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_IsLicensed.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_IsLicensed.pb\..\h.DBP_PatchCompiler.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_IsLicensed.pb\..\h.DBP_PatchCompiler.pb\..\lib.DBP_PatchCompiler.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_IsLicensed.pb\..\lib.DBP_IsLicensed.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_VDat.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\DBP\h.DBP.pb\..\h.DBP_VDat.pb\..\lib.DBP_VDat.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.StartMenuRequester.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.StartMenuRequester.pb\..\h.AlignedStringGadget.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.StartMenuRequester.pb\..\h.AlignedStringGadget.pb\..\lib.AlignedStringGadget.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.StartMenuRequester.pb\..\lib.StartMenuRequester.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.SpecialFolderLocation.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.SpecialFolderLocation.pb\..\lib.SpecialFolderLocation.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.XMLPackager.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.XMLPackager.pb\..\lib.XMLPackager.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.INI.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.INI.pb\..\lib.INI.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.StripCharacters.pb
Including source: G:\PureGDK_Dev\workspaces\installer\././prj.Installer.pb\..\h.Installer.pb\..\..\..\includes\PureBasic\h.StripCharacters.pb\..\lib.StripCharacters.pb
4299 lines processed.
Creating executable "PureGDK_Upgrade-2.0b-1.exe".

- Feel the ..PuRe.. Power -
Compilation ok!
Post Reply