Platform/Platform-specific build defines: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(→‎Prefs files: Drop B2G rows)
(→‎Prefs files: Drop B2G columns, add GeckoView)
Line 305: Line 305:
{|border="1" style="text-align: center; width: 100%"
{|border="1" style="text-align: center; width: 100%"
!OS
!OS
!colspan="3"|Windows
!colspan="1"|Windows
!colspan="3"|OS X
!colspan="1"|OS X
!colspan="3"|Linux-gtk
!colspan="1"|Linux-gtk
!colspan="2"|Android
!colspan="2"|Android
!iOS
!iOS
!FxOS TV
|-
|-
!Product
!Product
!Desktop
!Desktop
!B2G
!Mulet
!Desktop
!Desktop
!B2G
!Mulet
!Desktop
!Desktop
!B2G
!Mulet
!Fennec
!Fennec
!B2G
!GeckoView
!iOS
!iOS
!FxOS TV
|-
|-
|[https://hg.mozilla.org/mozilla-central/file/tip/modules/libpref/init/all.js all.js]
|[https://hg.mozilla.org/mozilla-central/file/tip/modules/libpref/init/all.js all.js]
   <!-- Windows: Desktop, B2G, Mulet -->
   <!-- Windows: Desktop -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
  <!-- OS X: Desktop -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
  <!-- Linux-gtk: Desktop -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
  <!-- OS X: Desktop, B2G, Mulet -->
   <!-- Android: Fennec, GeckoView -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
  <!-- Linux-gtk: Desktop, B2G, Mulet -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
   <!-- Android: Fennec, B2G -->
|  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"|✓
  <!-- FxOS TV -->
|  ??
|-
|-
|[https://hg.mozilla.org/mozilla-central/file/tip/browser/app/profile/firefox.js firefox.js]
|[https://hg.mozilla.org/mozilla-central/file/tip/browser/app/profile/firefox.js firefox.js]
   <!-- Windows: Desktop, B2G, Mulet -->
   <!-- Windows: Desktop -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
|  &nbsp;
  <!-- OS X: Desktop -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
   <!-- OS X: Desktop, B2G, Mulet -->
   <!-- Linux-gtk: Desktop -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
  <!-- Android: Fennec, GeckoView -->
|  &nbsp;
|  &nbsp;
style="background: green; color: white"|✓
??
  <!-- Linux-gtk: Desktop, B2G, Mulet -->
|  style="background: green; color: white"|✓
|  &nbsp;
|  style="background: green; color: white"|✓
  <!-- Android: Fennec, B2G -->
|  &nbsp;
|  &nbsp;
   <!-- iOS -->
   <!-- iOS -->
|  &nbsp;
|  &nbsp;
  <!-- FxOS TV -->
|  ??
|-
|-
|[https://hg.mozilla.org/mozilla-central/file/tip/mobile/android/app/mobile.js mobile.js]
|[https://hg.mozilla.org/mozilla-central/file/tip/mobile/android/app/mobile.js mobile.js]
   <!-- Windows: Desktop, B2G, Mulet -->
   <!-- Windows: Desktop -->
|  &nbsp;
|  &nbsp;
  <!-- OS X: Desktop -->
|  &nbsp;
|  &nbsp;
  <!-- Linux-gtk: Desktop -->
|  &nbsp;
|  &nbsp;
  <!-- OS X: Desktop, B2G, Mulet -->
   <!-- Android: Fennec, GeckoView -->
|  &nbsp;
|  &nbsp;
|  &nbsp;
  <!-- Linux-gtk: Desktop, B2G, Mulet -->
|  &nbsp;
|  &nbsp;
|  &nbsp;
   <!-- Android: Fennec, B2G -->
|  style="background: green; color: white"|✓
|  style="background: green; color: white"|✓
&nbsp;
??
   <!-- iOS -->
   <!-- iOS -->
|  &nbsp;
|  &nbsp;
  <!-- FxOS TV -->
|  ??
|}
|}
'''WARNING''': Until {{bug|1174234}} is resolved firefox.js prefs will override mulet.js prefs on Mulet.


== Reftest conditions ==
== Reftest conditions ==

Revision as of 20:55, 9 October 2018

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 FxOS TV
Product Desktop B2G Mulet Desktop B2G Mulet Desktop B2G Mulet Fennec B2G iOS FxOS TV
XP_WIN                   ??
XP_DARWIN                 ??
XP_MACOSX                   ??
XP_IOS                       ??
XP_UNIX       ??
XP_LINUX               ??
ANDROID                     ??
MOZ_B2G           ??
MOZ_MULET                   ??
MOZ_WIDGET_GTK                   ??
MOZ_WIDGET_ANDROID                       ??
MOZ_WIDGET_GONK                        
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       ??  

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 B2G Desktop B2G Desktop B2G Mulet Fennec B2G iOS
B2G                  
B2GDT              
Android                  
cocoaWidget                
gtkWidget              
qtWidget                    
winWidget                
Mulet                  

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 B2G Desktop B2G Desktop B2G Mulet Fennec B2G iOS
os win ?? mac ?? linux ?? ?? android b2g ??
toolkit windows ?? cocoa ?? gtk2 or gtk3 ?? ?? android gonk ??
buildapp ?? ?? ?? ?? ?? ?? mulet ?? b2g ??

You may also be interested in Platform/Channel-specific_build_defines