x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Conditionally compile plugins based on platform

I'm using Unreal Version 4.9.2

I would like to know is there a way to conditionally compile plugins based on the current platform?

For example,

I have a project that works perfectly (compiling in VS 2013) for development in a windows environment and has a few Custom Plugins that all work properly. That being said, if I transfer said project over to my Macbook (MacOS) to do further development, the project fails to completely compile w/ XCode.

The reason the project won't compile is simple, my Custom Plugins only work on Windows (due to Library requirements *.dll etc).

That being said, is there a configuration I can use to just simply say "Hey UE4, please don't even TRY to compile those plugins" ONLY when we are in a MacOS environment?

I feel like there is something I can edit in each of the Plugins *.build.cs file. But I'm not exactly sure which steps I can take. Simply removing the plugin from the project is NOT an option because we are using Revision control, and don't want to have 2 separate sets of Source Code just because of a few plugins.

Thanks in advance for any answers. Much appreciated.

Product Version: UE 4.9
Tags:
more ▼

asked Dec 10 '15 at 08:19 PM in C++ Programming

avatar image

JHoward
21 1 2 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

You specify the platforms in the .uplugin file. Like so:

 "Modules" :
 [
     {
         "Name": "FlurryEditor",
         "Type": "Editor"
     },
     {
         "Name" : "IOSFlurry",
         "Type" : "Runtime",
         "LoadingPhase" : "PreDefault",
         "WhitelistPlatforms" : [ "IOS" ]
     }
 ]
more ▼

answered Dec 10 '15 at 08:52 PM

avatar image

joeGraf STAFF
1.5k 35 12 69

avatar image JHoward Dec 18 '15 at 01:13 AM

I don't want to mislead anyone, but this DID NOT work for me. I've tried "WhiteListPlatforms", and "BlackListPlatforms."

In both cases, after re-generating project files, XCODE was still trying to Compile a plugin that I had BlackListed for IOS.

I'm going to write this one off as a bug.

That being said, I found a solution:

Just delete the .uplugin file that you "DO NOT" want to even try to compile. This is a much simpler approach, and it won't allow the "Project File Generation" code to even notice that's a plugin and add it to the build list.

My observations:

If you are under version control software such as Perforce, each time you grab the latest version, this file (*.uplugin) will be added back to the project file structure, just don't forget to "re-delete" it. That should take care of the problem until "WhiteListPlatforms" or "BlackListPlatforms" starts working again.

I cannot give any source, as I am under NDA / working for a company which it is NOT allowed. I deeply apologize that I cannot provide samples.

avatar image DaveCSumo Sep 13 '17 at 08:58 AM

Might want to try using a lower case L in "WhitelistPlatforms".

avatar image GTG2K16 Oct 20 '17 at 12:20 PM

This Works i have this tested for AdvanceSession and Android Build..

 "Modules" :
     [
         {
             "Name" : "AdvancedSteamSessions",
             "Type" : "RunTime",
             "LoadingPhase" : "PreDefault",
             "WhitelistPlatforms" :
             [
                 "Win32",
                 "Win64"
             ]
         } 
     ],
     "Plugins": [
         {
             "Name": "AdvancedSessions",
             "Enabled": true
         },..........

And compile Works Thx

avatar image DanielDurys Jan 17 '18 at 02:06 PM

It works for me too, thanks :)

avatar image KEATE- Dec 08 '18 at 02:37 PM

That works for me2...I'm trying to set the target platform for a long time.Thx...

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

"SupportedTargetPlatforms": [ "Win64" ] or "TargetPlatforms": [ "Android", "IOS" ]

more ▼

answered May 21 '19 at 08:19 PM

avatar image

corejake
1 3 2 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question