Platform/Platform-specific build defines: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(→‎Prefs files: GV doesn't use firefox.js but does use all.js. Not sure about mobile.js yet)
(Update android condition)
Line 26: Line 26:
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
|  &nbsp;
|  &nbsp;
??
&nbsp;
   <!-- iOS -->
   <!-- iOS -->
|  &nbsp;
|  &nbsp;
Line 39: Line 39:
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
|  &nbsp;
|  &nbsp;
??
&nbsp;
   <!-- iOS -->
   <!-- iOS -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
Line 52: Line 52:
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
|  &nbsp;
|  &nbsp;
??
&nbsp;
   <!-- iOS -->
   <!-- iOS -->
|  &nbsp;
|  &nbsp;
Line 65: Line 65:
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
|  &nbsp;
|  &nbsp;
??
&nbsp;
   <!-- iOS -->
   <!-- iOS -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
Line 78: Line 78:
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
??
style="background: green; color: white"|✓
   <!-- iOS -->
   <!-- iOS -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
Line 91: Line 91:
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
??
style="background: green; color: white"|✓
   <!-- iOS -->
   <!-- iOS -->
|  &nbsp;
|  &nbsp;
Line 104: Line 104:
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
??
style="background: green; color: white"|✓
   <!-- iOS -->
   <!-- iOS -->
|  &nbsp;
|  &nbsp;
Line 117: Line 117:
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
|  &nbsp;
|  &nbsp;
??
&nbsp;
   <!-- iOS -->
   <!-- iOS -->
|  &nbsp;
|  &nbsp;
Line 130: Line 130:
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
??
style="background: green; color: white"|✓
   <!-- iOS -->
   <!-- iOS -->
|  &nbsp;
|  &nbsp;
Line 143: Line 143:
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
|  &nbsp;
|  &nbsp;
??
&nbsp;
   <!-- iOS -->
   <!-- iOS -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
Line 250: Line 250:
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
??
style="background: green; color: white"|✓
   <!-- iOS -->
   <!-- iOS -->
|  &nbsp;
|  &nbsp;
Line 263: Line 263:
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
|  &nbsp;
|  &nbsp;
??
&nbsp;
   <!-- iOS -->
   <!-- iOS -->
|  &nbsp;
|  &nbsp;
Line 276: Line 276:
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
|  &nbsp;
|  &nbsp;
??
&nbsp;
   <!-- iOS -->
   <!-- iOS -->
|  &nbsp;
|  &nbsp;
Line 289: Line 289:
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
|  &nbsp;
|  &nbsp;
??
&nbsp;
   <!-- iOS -->
   <!-- iOS -->
|  &nbsp;
|  &nbsp;
Line 302: Line 302:
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
|  &nbsp;
|  &nbsp;
??
&nbsp;
   <!-- iOS -->
   <!-- iOS -->
|  &nbsp;
|  &nbsp;
Line 336: Line 336:
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
|  android
|  android
??
android
   <!-- iOS -->
   <!-- iOS -->
|  ??
|  ??
Line 349: Line 349:
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
|  android
|  android
??
android
   <!-- iOS -->
   <!-- iOS -->
|  ??
|  ??
Line 361: Line 361:
|  ??
|  ??
   <!-- Android: Fennec, GeckoView -->
   <!-- Android: Fennec, GeckoView -->
??
mobile/android
|  ??
|  ??
   <!-- iOS -->
   <!-- iOS -->

Revision as of 04:01, 30 May 2019

In the Gecko code we have a bunch of preprocessor conditions that help us conditionally compile code for specific platforms. These can get confusing so here is a handy-dandy table to help you keep them straight.

OS Windows OS X Linux-gtk Android iOS
Product Desktop Desktop Desktop Fennec GeckoView iOS
XP_WIN          
XP_DARWIN        
XP_MACOSX          
XP_IOS          
XP_UNIX  
XP_LINUX      
ANDROID        
MOZ_WIDGET_GTK          
MOZ_WIDGET_ANDROID        
MOZ_WIDGET_UIKIT          

Prefs files

Here is a similar table, but to see which prefs get used in which product:

OS Windows OS X Linux-gtk Android iOS
Product Desktop Desktop Desktop Fennec GeckoView iOS
all.js
firefox.js      
mobile.js       ??  
geckoview-prefs.js          

Reftest conditions

Here is another table that tells you what conditions are true on various platforms for use in reftest.list conditions.

OS Windows OS X Linux-gtk Android iOS
Product Desktop Desktop Desktop Fennec GeckoView iOS
Android        
cocoaWidget          
gtkWidget          
qtWidget            
winWidget          

Mochitest conditions

Here is another table that tells you what different condition values are on various platforms for use in mochitest.ini/a11y.ini/chrome.ini/browser.ini conditions.

OS Windows OS X Linux-gtk Android iOS
Product Desktop Desktop Desktop Fennec GeckoView iOS
os win mac linux android android ??
toolkit windows cocoa gtk2 or gtk3 android android ??
buildapp ?? ?? ?? mobile/android ?? ??

You may also be interested in Platform/Channel-specific_build_defines