| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 if (current_cpu == "x86" || current_cpu == "x64") { | 5 if (current_cpu == "x86" || current_cpu == "x64") { |
| 6 import("//third_party/yasm/yasm_assemble.gni") | 6 import("//third_party/yasm/yasm_assemble.gni") |
| 7 | 7 |
| 8 yasm_assemble("asm") { | 8 yasm_assemble("asm") { |
| 9 assert(current_cpu == "x86" || current_cpu == "x64") | 9 assert(current_cpu == "x86" || current_cpu == "x64") |
| 10 | 10 |
| 11 sources = [ "SaveRegisters_x86.asm" ] | 11 sources = [ |
| 12 "SaveRegisters_x86.asm", |
| 13 ] |
| 12 | 14 |
| 13 yasm_flags = [] | 15 yasm_flags = [] |
| 14 if (is_mac) { | 16 if (is_mac) { |
| 15 # Necessary to ensure symbols end up with a _ prefix; added by | 17 # Necessary to ensure symbols end up with a _ prefix; added by |
| 16 # yasm_compile.gypi for Windows, but not Mac. | 18 # yasm_compile.gypi for Windows, but not Mac. |
| 17 yasm_flags += [ "-DPREFIX" ] | 19 yasm_flags += [ "-DPREFIX" ] |
| 20 } |
| 21 if (current_cpu == "x64") { |
| 22 if (is_win) { |
| 23 yasm_flags += [ "-DX64WIN=1" ] |
| 24 } else { |
| 25 yasm_flags += [ "-DX64POSIX=1" ] |
| 26 } |
| 27 } else { # current_cpu == "x86" |
| 28 yasm_flags += [ "-DIA32=1" ] |
| 29 } |
| 18 } | 30 } |
| 19 if (current_cpu == "x64") { | 31 } else { # current_cpu == "x86" || current_cpu == "x64" |
| 20 if (is_win) { | 32 source_set("asm") { |
| 21 yasm_flags += [ "-DX64WIN=1" ] | 33 if (current_cpu == "arm") { |
| 22 } else { | 34 sources = [ |
| 23 yasm_flags += [ "-DX64POSIX=1" ] | 35 "SaveRegisters_arm.S", |
| 36 ] |
| 37 } else if (current_cpu == "arm64") { |
| 38 sources = [ |
| 39 "SaveRegisters_arm64.S", |
| 40 ] |
| 41 } else if (current_cpu == "mipsel") { |
| 42 sources = [ |
| 43 "SaveRegisters_mips.S", |
| 44 ] |
| 24 } | 45 } |
| 25 } else { # current_cpu == "x86" | 46 |
| 26 yasm_flags += [ "-DIA32=1" ] | 47 if (current_cpu == "arm") { |
| 48 defines = [ "ARM=1" ] |
| 49 } |
| 27 } | 50 } |
| 28 } | 51 } # current_cpu == "x86" || current_cpu == "x64" |
| 29 | |
| 30 } else { # current_cpu == "x86" || current_cpu == "x64" | |
| 31 | |
| 32 source_set("asm") { | |
| 33 if (current_cpu == "arm") { | |
| 34 sources = [ "SaveRegisters_arm.S" ] | |
| 35 } else if (current_cpu == "arm64") { | |
| 36 sources = [ "SaveRegisters_arm64.S" ] | |
| 37 } else if (current_cpu == "mipsel") { | |
| 38 sources = [ "SaveRegisters_mips.S" ] | |
| 39 } | |
| 40 | |
| 41 if (current_cpu == "arm") { | |
| 42 defines = [ "ARM=1" ] | |
| 43 } | |
| 44 } | |
| 45 | |
| 46 } # current_cpu == "x86" || current_cpu == "x64" | |
| 47 | |
| 48 | |
| OLD | NEW |