Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-07

IDE Macro for # of bits of the Source OS? (eg. 32-bit/64-bit -- A $(SrcCPU) would be nice!)

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Den

Hello all,

Is there a convenient way using Package "Conditionals" (Options -> Other) to detect if the SOURCE Operating System is 32bit/64bit? Kinda like $(TargetCPU) but a $(SrcCPU)?

Thanks!

- Dennis Fehr

Reply by email

Den
to Sven Barth

Actually, I ended up using GetIDEValue('CPU') for it. But now I need the TargetProcessor.. It's configuring for my Android Library Package so it can properly detect where the ANDROID NDK is automatically. So far everything is able to detect with defaults and NO overrides (Build Macro Definition Overrides).. I didn't want the user to have to define ANY. I would like to pull the "TargetProcessor" value from the "Config and Target" from the user's project, like I am with TargetCPU and TargetOS, etc.

Problem is, I don't think FPC defines the Processor Conditional..

- Dennis Fehr

Sven Barth wrote 22 lines
Am 08.07.2014 07:47 schrieb "Den" < <mailto:>>: > > Hello all, > > Is there a convenient way using Package "Conditionals" (Options -> Other) to detect if the SOURCE Operating System is 32bit/64bit? Kinda like $(TargetCPU) but a $(SrcCPU)? Why do you need that? Regards, Sven -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140708/762fccfc/attachment.html>

Reply by email

Sven Barth
to Den
"Den" wrote
Actually, I ended up using GetIDEValue('CPU') for it. But now I need

the TargetProcessor.. It's configuring for my Android Library Package so it can properly detect where the ANDROID NDK is automatically. So far everything is able to detect with defaults and NO overrides (Build Macro Definition Overrides).. I didn't want the user to have to define ANY. I would like to pull the "TargetProcessor" value from the "Config and Target" from the user's project, like I am with TargetCPU and TargetOS, etc.

Problem is, I don't think FPC defines the Processor Conditional..

FPC automatically defines CPUxyz for -Cpxyz, but it seems that Lazarus passes -Opxyz instead which is the CPU type which is optimized for. I'd consider this an error of Lazarus...

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140708/549e522b/attachment.html>

Reply by email

Mattias Gaertner
to Sven Barth
[...] FPC automatically defines CPUxyz for -Cpxyz, but it seems that Lazarus passes -Opxyz instead which is the CPU type which is optimized for. I'd consider this an error of Lazarus...

When should -Cp be used and when -Op?

Mattias

Reply by email

Sven Barth
to Mattias Gaertner
"Mattias Gaertner" wrote 10 lines
On Tue, 8 Jul 2014 12:07:46 +0200 Sven Barth wrote: >[...] > FPC automatically defines CPUxyz for -Cpxyz, but it seems that Lazarus > passes -Opxyz instead which is the CPU type which is optimized for. I'd > consider this an error of Lazarus... When should -Cp be used and when -Op?

-Cp sets the target processor. Especially important for platforms like ARM and m68k (additionally the corresponding CPU defines are set with this) -Op sets the processor for which to optimize. I don't know just now whether -Cp influences -Op, but the other way round is definitely not true.

So -Cp needs to be set always (if it isn't left blank), while -Op *can* be set.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140715/ee59a755/attachment.html>

Reply by email

Mattias Gaertner
to Sven Barth
Show quoted text 19 lines
Am 15.07.2014 12:23 schrieb "Mattias Gaertner" : > > On Tue, 8 Jul 2014 12:07:46 +0200 > Sven Barth wrote: > > >[...] > > FPC automatically defines CPUxyz for -Cpxyz, but it seems that Lazarus > > passes -Opxyz instead which is the CPU type which is optimized for. I'd > > consider this an error of Lazarus... > > When should -Cp be used and when -Op? -Cp sets the target processor. Especially important for platforms like ARM and m68k (additionally the corresponding CPU defines are set with this) -Op sets the processor for which to optimize. I don't know just now whether -Cp influences -Op, but the other way round is definitely not true. So -Cp needs to be set always (if it isn't left blank), while -Op *can* be set.

Thanks for the explanation.
I changed the -Op to -Cp.

Mattias

Reply by email