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

Mailing lists / lazarus / 2014-07
7 messages · 3 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
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
"Den" wroteHello 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140708/d5701cb4/attachment.html>
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140708/762fccfc/attachment.html>
"Den" wroteActually, 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>
[...] 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
-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>
Thanks for the explanation.
I changed the -Op to -Cp.
Mattias