blob: fe44daf27a5437a8dd4d6aa69df17aa5d61f4018 [file] [log] [blame]
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
if (current_cpu == "x86" || current_cpu == "x64") {
import("//third_party/nasm/nasm_assemble.gni")
nasm_assemble("asm") {
assert(current_cpu == "x86" || current_cpu == "x64")
sources = [ "SaveRegisters_x86.asm" ]
defines = []
if (is_mac) {
# Necessary to ensure symbols end up with a _ prefix; added by
# yasm_compile.gypi for Windows, but not Mac.
defines += [ "PREFIX" ]
}
if (current_cpu == "x64") {
if (is_win) {
defines += [ "X64WIN=1" ]
} else {
defines += [ "X64POSIX=1" ]
}
} else { # current_cpu == "x86"
defines += [ "IA32=1" ]
}
}
} else { # current_cpu == "x86" || current_cpu == "x64"
source_set("asm") {
if (current_cpu == "arm") {
sources = [ "SaveRegisters_arm.S" ]
} else if (current_cpu == "arm64") {
sources = [ "SaveRegisters_arm64.S" ]
} else if (current_cpu == "mipsel") {
sources = [ "SaveRegisters_mips.S" ]
} else if (current_cpu == "mips64el") {
sources = [ "SaveRegisters_mips64.S" ]
} else if (current_cpu == "ppc64") {
sources = [ "SaveRegisters_ppc64.S" ]
}
if (current_cpu == "arm") {
defines = [ "ARM=1" ]
}
}
} # current_cpu == "x86" || current_cpu == "x64"