Different source code options for different OS!

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

Different source code options for different OS!

Post by Lebostein »

At the moment it is annoying to create executables on different OS with single code:

Code: Select all

; UseIcon = engine_v3.icns
; Executable = engine_v3.app
or

Code: Select all

; UseIcon = engine_v3.ico
; Executable = engine_v3.exe
That should be better:

Code: Select all

; UseIcon_mac = engine_v3.icns
; Executable_mac = engine_v3.app
; UseIcon_win = engine_v3.ico
; Executable_win = engine_v3.exe
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: Different source code options for different OS!

Post by PB »

From the manual:

Code: Select all

CompilerSelect #PB_Compiler_OS
  CompilerCase #PB_OS_AmigaOS
    ; some Amiga specific code
  CompilerCase #PB_OS_Linux
    ; some Linux specific code
CompilerEndSelect
But you can't compile a Mac app from a Windows PC,
if that's what you're after? Cross-platform compilation
is not possible, nor coming (it's been requested before).
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Different source code options for different OS!

Post by IdeasVacuum »

Cross-platform compilation
is not possible, nor coming (it's been requested before).
...and though it sounds great, it's not really practical because you need to conduct your testing on the actual platforn targeted.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Deluxe0321
User
User
Posts: 69
Joined: Tue Sep 16, 2008 6:11 am
Location: ger

Re: Different source code options for different OS!

Post by Deluxe0321 »

I assume Lebostein meant the compiler settings (Icon, Version, "applocation", etc.) for each OS - not the code itself.
Currently you need to redefine these settings every time if you switch the OS.

I recommend to use a Purebasic project in order to define a "compile-target" for each OS.
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Different source code options for different OS!

Post by Fred »

This request makes sens
Post Reply