* * *

Author Topic: TargetOS returns "win32" or "win64". I need alternative option  (Read 2045 times)

Igor Kokarev

  • New member
  • *
  • Posts: 30
TargetOS returns "win32" or "win64". I need alternative option
« on: September 05, 2018, 03:11:58 pm »
Hi,

TargetOS option gives 2 results on Windows - "win32" or "win64". And "darwin" on macOS (32-bit or 64-bit).

Is there any alternative to TargetOS which will give one result on 32-bit and 64-bit version of Windows (for example, "win") and "darwin" for Mac?

We develop a cross-platform app and we plan to use just 2 folders with platform units - one folder Windows (32-bit or 64-bit) app and one for Mac. Currently we use TargetOS in Paths in the Project Options:
\Sources\$(TargetOS)

ASerge

  • Hero Member
  • *****
  • Posts: 967
Re: TargetOS returns "win32" or "win64". I need alternative option
« Reply #1 on: September 05, 2018, 10:41:07 pm »
Currently we use TargetOS in Paths in the Project Options: \Sources\$(TargetOS)
\Sources\$(SrcOS)

Igor Kokarev

  • New member
  • *
  • Posts: 30
Re: TargetOS returns "win32" or "win64". I need alternative option
« Reply #2 on: September 06, 2018, 01:11:03 pm »
Thanks! It works.

Igor Kokarev

  • New member
  • *
  • Posts: 30
Re: TargetOS returns "win32" or "win64". I need alternative option
« Reply #3 on: September 06, 2018, 01:22:58 pm »
On macOS $(SrcOS) returns "unix".

How to get "win" and "macOS"?

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 4905
    • wiki
Re: TargetOS returns "win32" or "win64". I need alternative option
« Reply #4 on: September 06, 2018, 07:35:06 pm »
not a direct answer, but have a look at "custom options" (in project options). There is a field conditional, with example in it. You should probably be able to set anything you need in there.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2020
    • havefunsoft.com
Re: TargetOS returns "win32" or "win64". I need alternative option
« Reply #5 on: September 06, 2018, 07:55:08 pm »
not a direct answer, but have a look at "custom options" (in project options). There is a field conditional, with example in it. You should probably be able to set anything you need in there.
another way is to add build modes to project and create an additional IDE macro for the purpose.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

Leledumbo

  • Hero Member
  • *****
  • Posts: 7971
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: TargetOS returns "win32" or "win64". I need alternative option
« Reply #6 on: September 07, 2018, 11:54:33 am »
These are IDE supported macros, if none of them satisfying, I guess you really have to use custom options.
« Last Edit: September 10, 2018, 04:44:57 am by Leledumbo »


Igor Kokarev

  • New member
  • *
  • Posts: 30
Re: TargetOS returns "win32" or "win64". I need alternative option
« Reply #8 on: September 10, 2018, 12:56:48 pm »
Thanks! I will check it today.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus