Search Unity

Can i use scripting defines in native code

Discussion in 'iOS and tvOS' started by liortal, Oct 19, 2018.

  1. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    I recall reading about this a long time ago, but cannot find any sources in the documentation to validate this:

    Let's consider some scripting define such as UNITY_IOS (which is added automatically by Unity), or anything else custom (e.g: MY_CUSTOM_DEFINE).

    Can these be used later on in native (obj-c) code ? how are these passed to the Xcode project?
     
  2. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,624
    >>Can these be used later on in native (obj-c) code
    no
    >>how are these passed to the Xcode project?
    they are not.

    you can try looking into https://docs.unity3d.com/ScriptReference/iOS.Xcode.PBXProject.html
    with that you might add your own prefix/precompiled header which you would tweak from build scripts. But yes, you are on your own 8)
     
    liortal likes this.
  3. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    Thanks for the reply. i wonder why i recalled that it's supported :)