Hi all,
Right now you can add several targets to a project and either compile a single target or compile all targets. I was wondering if there is a possibility of compiling groups of targets
I have a massive project, separated in several modules (with for each platform a different target (Win x64/x86, Linux x64/x86, MacOS x64/x86) and right now if I want to compile a subset of targets, I have to compile all of them. I considered separating the groups into several projects, however you can have only one project open in PureBasic - so that's not efficient in my project.
Does anyone know how I can compile groups of targets or can anyone tell me if that's a feature that will ever be implemented in the IDE? I checked the pbcompiler flags if it is possible to compile a project on CLI, specifying a target, but that doesn't seem to be the case; it appears that the targets are handled in the IDE.
Cheers,
Bas
PureBasic Project: Compile groups of targets
- Crusiatus Black
- Enthusiast
- Posts: 389
- Joined: Mon May 12, 2008 1:25 pm
- Location: The Netherlands
- Contact:
Re: PureBasic Project: Compile groups of targets
You can tell the IDE to compile a project via the commandline. You can even compile multiple targets this way.
quidquid Latine dictum sit altum videtur
- Crusiatus Black
- Enthusiast
- Posts: 389
- Joined: Mon May 12, 2008 1:25 pm
- Location: The Netherlands
- Contact:
Re: PureBasic Project: Compile groups of targets
Hi freak,
Thanks, I didn't know that! I can make groups of targets that way and integrate it as a tool.
It still would be awesome if it would be added to the IDE some day though, as graphical option
Thanks, I didn't know that! I can make groups of targets that way and integrate it as a tool.
It still would be awesome if it would be added to the IDE some day though, as graphical option
Re: PureBasic Project: Compile groups of targets
It's not the nicest way, but I use constants to force compiler errors, so only the targets for this OS build when I hit "Build All".
For example, put something like this in your code:
Then for each target, go to Compiler Options > Constants > Custom Constants and add
or similar for each OS.
Then when you Build All, the targets for other OS'es will error out.
EDIT: Simpler yet, just use this, then you can define your own messages instead of messages about constant errors.
For example, put something like this in your code:
Code: Select all
CompilerSelect (#PB_Compiler_OS)
CompilerCase (#PB_OS_Windows)
#WindowsBuild = 1
#MacBuild = 0
CompilerCase (#PB_OS_MacOS)
#WindowsBuild = 0
#MacBuild = 1
CompilerEndSelect
Code: Select all
#WindowsBuild = 1
Then when you Build All, the targets for other OS'es will error out.
EDIT: Simpler yet, just use this, then you can define your own messages instead of messages about constant errors.
Code: Select all
CompilerIf (Defined(WindowsBuild, #PB_Constant) And (#PB_Compiler_OS <> #PB_OS_Windows))
CompilerError "Windows build disabled on this OS"
CompilerElseIf (Defined(MacBuild, #PB_Constant) And (#PB_Compiler_OS <> #PB_OS_MacOS))
CompilerError "Mac build disabled on this OS"
CompilerEndIf
Last edited by kenmo on Wed Feb 28, 2018 1:59 pm, edited 1 time in total.
- Crusiatus Black
- Enthusiast
- Posts: 389
- Joined: Mon May 12, 2008 1:25 pm
- Location: The Netherlands
- Contact:
Re: PureBasic Project: Compile groups of targets
Yes, however I don't want that to happen as I also use the build success indicaters to actually see if a build succeeds. Using the PB Editor's flags are just the right thing for me!
Thanks
Thanks