Like most traditional compiler/linkers, please add a compiler option /INCLUDE as a search path for IncludeFile/XIncludeFile. Also, please add a compiler option /RELATIVE to resolve IncludeFile/XIncludeFile paths relative to the particular file being examined instead of just the main source file.
Trying to work with PureBasic from the command line is excruciatingly difficult. I already can't split files away from my projects as reusable code because IncludeFile/XIncludeFile is so difficult to work with. I want "one" variant of a particular library on my system which all projects tap into instead of having to copy it into every project.
Relative paths and /INCLUDE is a beautiful solution. When working with C/C++, compiling on -any- system is a complete no brainer. All of my libraries and compilers are stored in a very logical directory structure and commanded by a custom build system that allows me to compile anywhere and everywhere by running one shell file to automatically configure my environment.
For command line compiler's sake, please add these features. I want to compile my entire project from one shell script and not have to worry about whether my relative path hack is going to freak out because the path is too deep or whether I remembered to update my project's libraries with the latest revision.
I am THIS close *makes a suggestively small space between thumb and index finger* to completely abandoning the IDE and hacking together my own completely incompatible compile-time parser to splice out includes on the fly to imitative this behavior. But I like the IDE. I like it a lot. Please add this fundamental feature to the compiler.
Please, please, PLEASE add this!
Please add options /INCLUDE and /RELATIVE to the compiler
Re: Please add options /INCLUDE and /RELATIVE to the compile
Mistrel, perhaps I'm stupid, but...
... here's my PureBasic folder setup:
In all my code, my includes point to: "..\x_lib\x_lib.pb" etc. which is a relative path to, for example, the sources of CodeCaddy I tend to keep in the 'codecaddy' folder...
I think I must misunderstand your request
... here's my PureBasic folder setup:
Code: Select all
projects
x_lib
g_spot
...
...
codecaddy
I think I must misunderstand your request

( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
Re: Please add options /INCLUDE and /RELATIVE to the compile
Include paths are relative to the main file being compiled. Not to the individual file being evaluated by the compiler.
http://www.purebasic.fr/english/viewtop ... =3&t=43921
http://www.purebasic.fr/english/viewtop ... 13&t=35288
http://www.purebasic.fr/english/viewtopic.php?t=30504
Also for your example:
If you compile g_spot and include "..\x_lib\x_lib.pb" which also includes "..\codecaddy\somelib.pb", the path ""..\codecaddy\" is relative to g_spot not x_lib, where the include is declared. But if your includes are very simple like this you won't notice much of a difference.
http://www.purebasic.fr/english/viewtop ... =3&t=43921
http://www.purebasic.fr/english/viewtop ... 13&t=35288
http://www.purebasic.fr/english/viewtopic.php?t=30504
Also for your example:
Code: Select all
projects
x_lib
g_spot
...
...
codecaddy
Re: Please add options /INCLUDE and /RELATIVE to the compile
Ah, I see what you mean. I think the point is that I do not do nested includes, ie. SweetSpot and CodeCaddy both use the same includes and paths:
But then again, I am a simple person 
Code: Select all
...
IncludeFile("..\x_lib\x_lib.pb")
IncludeFile("..\g_spot\g_spot.pb")
..

( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )