bug 1399878 - Use LOCAL_INCLUDES instead of CFLAGS in some media moz.build files. r?gps draft
authorTed Mielczarek <ted@mielczarek.org>
Thu, 14 Sep 2017 06:39:27 -0400
changeset 668587 ec2543d6a0a712fd5843ecc99e59ae004781a14a
parent 668586 e55f5733b30b15527f7a40df4ae56fb15062f9cd
child 668588 6b5464233197bc531e3e85304f4ca0c9ddadefec
push id81087
push userbmo:ted@mielczarek.org
push dateThu, 21 Sep 2017 20:59:05 +0000
reviewersgps
bugs1399878
milestone57.0a1
bug 1399878 - Use LOCAL_INCLUDES instead of CFLAGS in some media moz.build files. r?gps MozReview-Commit-ID: 3PUOniPnt54
media/libaom/moz.build
media/libvpx/moz.build
--- a/media/libaom/moz.build
+++ b/media/libaom/moz.build
@@ -11,50 +11,50 @@ include('sources.mozbuild')
 
 # Linux, Mac and Win share file lists for x86* but not configurations.
 if CONFIG['CPU_ARCH'] == 'x86_64':
     EXPORTS.aom += files['X64_EXPORTS']
     SOURCES += files['X64_SOURCES']
     USE_YASM = True
     if CONFIG['OS_TARGET'] == 'WINNT':
         ASFLAGS += [ '-I%s/media/libaom/config/win/x64/' % TOPSRCDIR ]
-        CFLAGS += [ '-I%s/media/libaom/config/win/x64/' % TOPSRCDIR ]
+        LOCAL_INCLUDES += [ '/media/libaom/config/win/x64/' ]
         EXPORTS.aom += [ 'config/win/x64/aom_config.h' ]
     elif CONFIG['OS_TARGET'] == 'Darwin':
         ASFLAGS += [ '-I%s/media/libaom/config/mac/x64/' % TOPSRCDIR ]
-        CFLAGS += [ '-I%s/media/libaom/config/mac/x64/' % TOPSRCDIR ]
+        LOCAL_INCLUDES += [ '/media/libaom/config/mac/x64/' ]
         EXPORTS.aom += [ 'config/mac/x64/aom_config.h' ]
     else: # Android, Linux, BSDs, etc.
         ASFLAGS += [ '-I%s/media/libaom/config/linux/x64/' % TOPSRCDIR ]
-        CFLAGS += [ '-I%s/media/libaom/config/linux/x64/' % TOPSRCDIR ]
+        LOCAL_INCLUDES += [ '/media/libaom/config/linux/x64/' ]
         EXPORTS.aom += [ 'config/linux/x64/aom_config.h' ]
 elif CONFIG['CPU_ARCH'] == 'x86':
     EXPORTS.aom += files['IA32_EXPORTS']
     SOURCES += files['IA32_SOURCES']
     USE_YASM = True
     if CONFIG['OS_TARGET'] == 'WINNT':
         if CONFIG['CC_TYPE'] == 'gcc':
             ASFLAGS += [ '-I%s/media/libaom/config/win/mingw32/' % TOPSRCDIR ]
-            CFLAGS += [ '-I%s/media/libaom/config/win/mingw32/' % TOPSRCDIR ]
+            LOCAL_INCLUDES += [ '/media/libaom/config/win/mingw32/' ]
             EXPORTS.aom += [ 'config/win/mingw32/aom_config.h' ]
         else:
             ASFLAGS += [ '-I%s/media/libaom/config/win/ia32/' % TOPSRCDIR ]
-            CFLAGS += [ '-I%s/media/libaom/config/win/ia32/' % TOPSRCDIR ]
+            LOCAL_INCLUDES += [ '/media/libaom/config/win/ia32/' ]
             EXPORTS.aom += [ 'config/win/ia32/aom_config.h' ]
     else: # Android, Linux, BSDs, etc.
         ASFLAGS += [ '-I%s/media/libaom/config/linux/ia32/' % TOPSRCDIR ]
-        CFLAGS += [ '-I%s/media/libaom/config/linux/ia32/' % TOPSRCDIR ]
+        LOCAL_INCLUDES += [ '/media/libaom/config/linux/ia32/' ]
         EXPORTS.aom += [ 'config/linux/ia32/aom_config.h' ]
 elif CONFIG['CPU_ARCH'] == 'arm':
     EXPORTS.aom += files['ARM_EXPORTS']
     ASFLAGS += [
         '-I%s/media/libaom/config/linux/arm/' % TOPSRCDIR,
         '-I%s/libaom' % OBJDIR,
     ]
-    CFLAGS += [ '-I%s/media/libaom/config/linux/arm/' % TOPSRCDIR ]
+    LOCAL_INCLUDES += [ '/media/libaom/config/linux/arm/' ]
     EXPORTS.aom += [ 'config/linux/arm/aom_config.h' ]
 
     arm_asm_files = files['ARM_SOURCES']
 
     if CONFIG['VPX_AS_CONVERSION']:
         SOURCES += sorted([
             "!%s.S" % f if f.endswith('.asm') else f for f in arm_asm_files
         ])
@@ -74,17 +74,17 @@ elif CONFIG['CPU_ARCH'] == 'arm':
         ASFLAGS += [
             '-no-integrated-as',
         ]
 else:
     # Generic C-only configuration
     EXPORTS.aom += files['GENERIC_EXPORTS']
     SOURCES += files['GENERIC_SOURCES']
     ASFLAGS += [ '-I%s/media/libaom/config/generic/' % TOPSRCDIR ]
-    CFLAGS += [ '-I%s/media/libaom/config/generic/' % TOPSRCDIR ]
+    LOCAL_INCLUDES += [ '/media/libaom/config/generic/' ]
     EXPORTS.aom += [ 'config/generic/aom_config.h' ]
 
 # We allow warnings for third-party code that can be updated from upstream.
 ALLOW_COMPILER_WARNINGS = True
 
 FINAL_LIBRARY = 'gkmedias'
 
 if CONFIG['OS_TARGET'] == 'Android':
@@ -130,12 +130,12 @@ if CONFIG['CLANG_CXX'] or CONFIG['CLANG_
     ]
 
 ASFLAGS += CONFIG['VPX_ASFLAGS']
 ASFLAGS += [
     '-I.',
     '-I%s/third_party/aom' % TOPSRCDIR,
 ]
 
-CFLAGS += [
-    '-I%s/third_party/aom' % TOPSRCDIR,
-    '-I%s/media/libaom/config' % TOPSRCDIR, # aom_version.h
+LOCAL_INCLUDES += [
+    '/media/libaom/config', # aom_version.h
+    '/third_party/aom',
 ]
--- a/media/libvpx/moz.build
+++ b/media/libvpx/moz.build
@@ -13,42 +13,42 @@ if CONFIG['VPX_USE_YASM']:
     USE_YASM = True
 
 # Linux, Mac and Win share file lists for x86* but not configurations.
 if CONFIG['CPU_ARCH'] == 'x86_64':
     EXPORTS.vpx += files['X64_EXPORTS']
     SOURCES += files['X64_SOURCES']
     if CONFIG['OS_TARGET'] == 'WINNT':
         ASFLAGS += [ '-I%s/media/libvpx/config/win/x64/' % TOPSRCDIR ]
-        CFLAGS += [ '-I%s/media/libvpx/config/win/x64/' % TOPSRCDIR ]
+        LOCAL_INCLUDES += [ '/media/libvpx/config/win/x64/' ]
     elif CONFIG['OS_TARGET'] == 'Darwin':
         ASFLAGS += [ '-I%s/media/libvpx/config/mac/x64/' % TOPSRCDIR ]
-        CFLAGS += [ '-I%s/media/libvpx/config/mac/x64/' % TOPSRCDIR ]
+        LOCAL_includes += [ '/media/libvpx/config/mac/x64/' ]
     else: # Android, Linux, BSDs, etc.
         ASFLAGS += [ '-I%s/media/libvpx/config/linux/x64/' % TOPSRCDIR ]
-        CFLAGS += [ '-I%s/media/libvpx/config/linux/x64/' % TOPSRCDIR ]
+        LOCAL_INCLUDES += [ '/media/libvpx/config/linux/x64/' ]
 elif CONFIG['CPU_ARCH'] == 'x86':
     EXPORTS.vpx += files['IA32_EXPORTS']
     SOURCES += files['IA32_SOURCES']
     if CONFIG['OS_TARGET'] == 'WINNT':
         ASFLAGS += [ '-I%s/media/libvpx/config/win/ia32/' % TOPSRCDIR ]
-        CFLAGS += [ '-I%s/media/libvpx/config/win/ia32/' % TOPSRCDIR ]
+        LOCAL_INCLUDES += [ '/media/libvpx/config/win/ia32/' ]
     elif CONFIG['OS_TARGET'] == 'Darwin':
         ASFLAGS += [ '-I%s/media/libvpx/config/mac/ia32/' % TOPSRCDIR ]
-        CFLAGS += [ '-I%s/media/libvpx/config/mac/ia32/' % TOPSRCDIR ]
+        LOCAL_INCLUDES += [ '/media/libvpx/config/mac/ia32/' ]
     else: # Android, Linux, BSDs, etc.
         ASFLAGS += [ '-I%s/media/libvpx/config/linux/ia32/' % TOPSRCDIR ]
-        CFLAGS += [ '-I%s/media/libvpx/config/linux/ia32/' % TOPSRCDIR ]
+        LOCAL_INCLUDES += [ '/media/libvpx/config/linux/ia32/' ]
 elif CONFIG['CPU_ARCH'] == 'arm':
     EXPORTS.vpx += files['ARM_EXPORTS']
     ASFLAGS += [
         '-I%s/media/libvpx/config/linux/arm/' % TOPSRCDIR,
         '-I%s/libvpx' % OBJDIR,
     ]
-    CFLAGS += [ '-I%s/media/libvpx/config/linux/arm/' % TOPSRCDIR ]
+    LOCAL_INCLUDES += [ '/media/libvpx/config/linux/arm/' ]
 
     arm_asm_files = files['ARM_SOURCES']
 
     if CONFIG['VPX_AS_CONVERSION']:
         SOURCES += sorted([
             "!%s.S" % f if f.endswith('.asm') else f for f in arm_asm_files
         ])
     else:
@@ -67,17 +67,17 @@ elif CONFIG['CPU_ARCH'] == 'arm':
         ASFLAGS += [
             '-no-integrated-as',
         ]
 else:
     # Generic C-only configuration
     EXPORTS.vpx += files['GENERIC_EXPORTS']
     SOURCES += files['GENERIC_SOURCES']
     ASFLAGS += [ '-I%s/media/libvpx/config/generic/' % TOPSRCDIR ]
-    CFLAGS += [ '-I%s/media/libvpx/config/generic/' % TOPSRCDIR ]
+    LOCAL_INCLUDES += [ '/media/libvpx/config/generic/' ]
 
 # We allow warnings for third-party code that can be updated from upstream.
 ALLOW_COMPILER_WARNINGS = True
 
 FINAL_LIBRARY = 'gkmedias'
 
 DEFINES['HAVE_CONFIG_H'] = 'vpx_config.h'
 
@@ -125,18 +125,18 @@ if CONFIG['CLANG_CXX'] or CONFIG['CLANG_
     ]
 
 ASFLAGS += CONFIG['VPX_ASFLAGS']
 ASFLAGS += [
     '-I.',
     '-I%s/media/libvpx/libvpx' % TOPSRCDIR,
 ]
 
-CFLAGS += [
-    '-I%s/media/libvpx/libvpx' % TOPSRCDIR,
-    '-I%s/media/libvpx/config' % TOPSRCDIR, # vpx_version.h
+LOCAL_INCLUDES += [
+    '/media/libvpx/config', # vpx_version.h
+    '/media/libvpx/libvpx',
 ]
 
 if CONFIG['OS_TARGET'] == 'Android':
     # For LIBVPX_RAND
     ASFLAGS += [
         '-D__ANDROID__'
     ]