blob: 81da1116f068d618a05e887095c7381938c10128 [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.
import("//build/config/features.gni")
import("//build/config/ui.gni")
source_set("os_crypt") {
sources = [
"ie7_password_win.cc",
"ie7_password_win.h",
"keychain_password_mac.h",
"keychain_password_mac.mm",
"os_crypt.h",
"os_crypt_mac.mm",
"os_crypt_posix.cc",
"os_crypt_switches.cc",
"os_crypt_switches.h",
"os_crypt_win.cc",
]
deps = [
"//base",
"//crypto",
# TODO(tfarina): Remove this dep when http://crbug.com/363749 is fixed.
"//crypto:platform",
]
if (is_mac || is_ios) {
sources -= [ "os_crypt_posix.cc" ]
}
if (is_ios) {
set_sources_assignment_filter([])
sources += [
"keychain_password_mac.mm",
"os_crypt_mac.mm",
]
set_sources_assignment_filter(sources_assignment_filter)
}
if (is_win) {
libs = [ "crypt32.lib" ]
}
if (is_desktop_linux && (use_glib || use_dbus)) {
sources -= [ "os_crypt_posix.cc" ]
sources += [
"key_storage_linux.cc",
"key_storage_linux.h",
"os_crypt_linux.cc",
]
defines = []
if (use_glib) {
sources += [
"key_storage_libsecret.cc",
"key_storage_libsecret.h",
"libsecret_util_linux.cc",
"libsecret_util_linux.h",
]
configs += [ "//build/config/linux:glib" ]
deps += [ "//third_party/libsecret" ]
defines += [ "USE_LIBSECRET" ]
}
if (use_dbus) {
sources += [
"kwallet_dbus.cc",
"kwallet_dbus.h",
]
deps += [ "//dbus" ]
defines += [ "USE_KWALLET" ]
}
}
}
source_set("test_support") {
testonly = true
sources = [
"os_crypt_mocker.cc",
"os_crypt_mocker.h",
]
deps = [
":os_crypt",
"//base",
"//testing/gtest",
]
if (is_desktop_linux && (use_glib || use_dbus)) {
sources += [
"os_crypt_mocker_linux.cc",
"os_crypt_mocker_linux.h",
]
deps += [ "//third_party/libsecret" ]
defines = [ "USE_LIBSECRET" ]
}
}
source_set("unit_tests") {
testonly = true
sources = [
"ie7_password_win_unittest.cc",
"keychain_password_mac_unittest.mm",
"os_crypt_unittest.cc",
]
deps = [
":os_crypt",
":test_support",
"//base",
"//crypto",
"//testing/gmock",
"//testing/gtest",
]
if (is_desktop_linux && (use_glib || use_dbus)) {
sources += [ "os_crypt_linux_unittest.cc" ]
defines = []
if (use_glib) {
sources += [ "os_crypt_util_linux_unittest.cc" ]
deps += [ "//third_party/libsecret" ]
defines += [ "USE_LIBSECRET" ]
}
if (use_dbus) {
sources += [ "kwallet_dbus_unittest.cc" ]
deps += [
"//dbus",
"//dbus:test_support",
]
defines += [ "USE_KWALLET" ]
}
}
}