diff options
author | ckocagil@chromium.org <ckocagil@chromium.org> | 2014-09-25 21:58:35 +0000 |
---|---|---|
committer | ckocagil@chromium.org <ckocagil@chromium.org> | 2014-09-25 21:58:35 +0000 |
commit | d4edbc4ba038ec534d70f3543890f290b30b902c (patch) | |
tree | eb516fcdca914e7d255095e8e1417f991c59de54 | |
parent | efe9712d52c2d216fb3d1ceb508b8148847a7e4b (diff) | |
download | libvpx-d4edbc4ba038ec534d70f3543890f290b30b902c.tar.gz |
gn: Fix build on Windows
R=brettw@chromium.org, johannkoenig@google.com
Review URL: https://codereview.chromium.org/603173004
git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/libvpx@292146 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
-rw-r--r-- | BUILD.gn | 42 |
1 files changed, 36 insertions, 6 deletions
@@ -41,7 +41,9 @@ config("libvpx_config") { "//third_party/libvpx/source/libvpx", "$root_gen_dir/third_party/libvpx", # Provides vpx_rtcd.h. ] - cflags = [ "-Wno-unused-function", "-Wno-sign-compare" ] + if (!is_win) { + cflags = [ "-Wno-unused-function", "-Wno-sign-compare" ] + } } # This config is applied to targets that depend on libvpx. @@ -56,6 +58,8 @@ executable("libvpx_obj_int_extract") { "//third_party/libvpx/source/libvpx/build/make/obj_int_extract.c" ] configs += [ ":libvpx_config" ] + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] if (is_android_webview_build) { defines += [ "FORCE_PARSE_ELF" ] include_dirs += [ "//third_party/libvpx/include" ] @@ -69,6 +73,8 @@ static_library("libvpx_asm_offsets") { "//third_party/libvpx/source/libvpx/vpx_scale/vpx_scale_asm_offsets.c" ] configs += [ ":libvpx_config" ] + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] if (is_clang) { cflags = [ "-Wno-unused-function" ] } @@ -93,11 +99,17 @@ template("obj_int_extract") { args += [ "-f", "rvds" ] } + if (is_win) { + obj_extension = "obj" + } else { + obj_extension = "o" + } + args += [ "-b", rebase_path(get_label_info(":libvpx_asm_offsets", "target_out_dir")) + "/" + invoker.src_dir + "/libvpx_asm_offsets." + - invoker.obj_file_root + ".o" + invoker.obj_file_root + ".${obj_extension}" ] out_file = "$target_gen_dir/" + invoker.obj_file_root + ".asm" args += [ "-o", rebase_path(out_file) ] @@ -143,7 +155,11 @@ if (cpu_arch == "x86" || cpu_arch == "x64") { static_library("libvpx_intrinsics_mmx") { configs += [ ":libvpx_config" ] - cflags = [ "-mmmx" ] + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + if (!is_win) { + cflags = [ "-mmmx" ] + } if (cpu_arch == "x86") { sources = libvpx_srcs_x86_mmx } else if (cpu_arch == "x64") { @@ -153,7 +169,11 @@ static_library("libvpx_intrinsics_mmx") { static_library("libvpx_intrinsics_sse2") { configs += [ ":libvpx_config" ] - cflags = [ "-msse2" ] + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + if (!is_win) { + cflags = [ "-msse2" ] + } if (cpu_arch == "x86") { sources = libvpx_srcs_x86_sse2 } else if (cpu_arch == "x64") { @@ -163,7 +183,11 @@ static_library("libvpx_intrinsics_sse2") { static_library("libvpx_intrinsics_ssse3") { configs += [ ":libvpx_config" ] - cflags = [ "-mssse3" ] + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + if (!is_win) { + cflags = [ "-mssse3" ] + } if (cpu_arch == "x86") { sources = libvpx_srcs_x86_ssse3 } else if (cpu_arch == "x64") { @@ -173,7 +197,11 @@ static_library("libvpx_intrinsics_ssse3") { static_library("libvpx_intrinsics_sse4_1") { configs += [ ":libvpx_config" ] - cflags = [ "-msse4.1" ] + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] + if (!is_win) { + cflags = [ "-msse4.1" ] + } if (cpu_arch == "x86") { sources = libvpx_srcs_x86_sse4_1 } else if (cpu_arch == "x64") { @@ -255,6 +283,8 @@ static_library("libvpx") { sources = libvpx_srcs_arm64 } configs += [ ":libvpx_config" ] + configs -= [ "//build/config/compiler:chromium_code" ] + configs += [ "//build/config/compiler:no_chromium_code" ] deps = [] if (cpu_arch == "x86" || (cpu_arch == "x64" && !is_msan)) { deps += [ |