Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Exclude SDKs / folder from build targets

Discussion in 'Editor & General Support' started by Jelmer123, Nov 23, 2020.

  1. Jelmer123

    Jelmer123

    Joined:
    Feb 11, 2019
    Posts:
    243
    Hi

    Unity is a cross platform game engine. But how come it is so difficult to exclude some folders from a certain target?
    For example:
    I want the Oculus SDK in the Android Target (for Oculus Quest), but perhaps not when I'm building another scene from that project to iOS or WebGL...

    Should I create a custom build pipeline that excludes folders by adding a tide to the folder name before building, and then removing after building? That seems hacky.

    Or should I compile my scenes that target different targets, into asset bundles that get built into the final solution? Seems hacky for such an important thing

    Or should I compile it into an assembly?

    Or add platform dependant flags to every script in the Oculus SDK?

    Or is there a better way? :D
    I'd love to see the same setup as the plugins folder. E.g. you dump stuff in a platform specific folder.
     
    Last edited: Nov 23, 2020
  2. lugduweb

    lugduweb

    Joined:
    Mar 2, 2014
    Posts:
    50
    Hello, did you find a solution ?

    I have a suggestion I have not tested so far : maybe symbolic link that you would change when changing targets would do the trick:

    Directories:
    Assets
    TOTO_OCULUS
    TOTO_ANDROID

    Android build: Assets\toto -> TOTO_ANDROID
    Oculus build: Assets\toto -> TOTO_OCULUS


    switch_target_oculus.bat:
    mklink /D Assets\toto TOTO_OCULUS

    switch_target_android.bat:
    mklink /D Assets\toto TOTO_ANDROID

    On Linux or MacOSX, use "ln -s" command instead of "mklink /D"
     
  3. FdenUijl

    FdenUijl

    Joined:
    Sep 5, 2019
    Posts:
    29