How can I achieve something like this:
string[] defines = new string[] {
"DEBUG",
"FLURRY_API_KEY=XXXXXXXXXXXX",
};
PlayerSettings.SetScriptingDefineSymbolsForGroup(buildTargetGroup, string.Join(";", defines));
If the above example isn’t clear, I’m trying to not only define something called FLURRY_API_KEY but I also want it to have a specific value of “XXXXXXXXXXXX”. We have many different build configurations on many platforms and I’d like to be able to track them all individually by specifying compile time defines.
Ok this looks like its a C# limitation and #defines don’t work like they do in C\C++. Preprocessor directives - C# reference | Microsoft Learn
Whats kinds of techniques are people using in this kind of situation?
I have the same issue,Do you find the way?
I ended up doing it like this:
public class BuildSystemConstants {
// Specify per build configuration properties below
#if Define1
public static readonly string FlurryAPIKey = "";
public static readonly string SystemTypeName = "xxxxx";
#elif Define2
public static readonly string FlurryAPIKey = "";
public static readonly string SystemTypeName = "yyyyy";
#elif Define3
public static readonly string FlurryAPIKey = "";
public static readonly string SystemTypeName = "zzzzz";
}
#endif
And in my build script I define either Define1, Define2 or Define3 to activate those configurations
crushforth:
I ended up doing it like this:
public class BuildSystemConstants {
// Specify per build configuration properties below
#if Define1
public static readonly string FlurryAPIKey = "";
public static readonly string SystemTypeName = "xxxxx";
#elif Define2
public static readonly string FlurryAPIKey = "";
public static readonly string SystemTypeName = "yyyyy";
#elif Define3
public static readonly string FlurryAPIKey = "";
public static readonly string SystemTypeName = "zzzzz";
}
#endif
And in my build script I define either Define1, Define2 or Define3 to activate those configurations
A little complexity, But it’s work, thanks