blob: 42fa30c2e3d9886d0c2b8d915fc83888012ec6e6 [file] [log] [blame]
# Copyright 2015 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/compiler/compiler.gni")
import("//chrome/process_version_rc_template.gni")
assert(is_win)
group("port_monitor") {
public_deps = [
":port_monitor_dll",
]
}
shared_library("port_monitor_dll") {
output_name = "gcp_portmon"
if (current_cpu == "x64") {
output_name = "gcp_portmon64"
}
sources = [
"port_monitor.def",
"port_monitor_dll.cc",
]
deps = [
":lib",
":resources",
"//base",
"//chrome/common:constants",
"//chrome/common:version_header",
"//cloud_print/common",
"//cloud_print/virtual_driver/win",
]
libs = [ "userenv.lib" ]
}
group("copy_gcp_portmon_binaries") {
deps = [
":copy_gcp_portmon_dll",
]
# TODO(pastarmovj): Find some way to reference the pdb file for the 64bit dll
# simply using it in the sources directive causes gn to error when generating
# the build files.
}
if (current_cpu == "x64") {
copy("copy_gcp_portmon_dll") {
sources = [
"$root_out_dir/gcp_portmon64.dll",
]
outputs = [
"$root_out_dir/gcp_portmon.dll",
]
deps = [
":port_monitor_dll",
]
}
} else {
# Make sure that we have a copy of gcp_portmon64.dll in the root out
# directory.
if (is_clang) {
gcp_portmon64_toolchain = "//build/toolchain/win:win_clang_x64"
} else {
gcp_portmon64_toolchain = "//build/toolchain/win:x64"
}
gcp_portmon64_label = ":port_monitor_dll($gcp_portmon64_toolchain)"
gcp_portmon64_out_dir = get_label_info(gcp_portmon64_label, "root_out_dir")
if (symbol_level > 0) {
copy("copy_gcp_portmon_pdb") {
visibility = [ ":copy_gcp_portmon_dll" ]
sources = [
"$gcp_portmon64_out_dir/gcp_portmon64.dll.pdb",
]
outputs = [
"$root_out_dir/{{source_file_part}}",
]
deps = [
gcp_portmon64_label,
]
}
}
copy("copy_gcp_portmon_dll") {
sources = [
"$gcp_portmon64_out_dir/gcp_portmon64.dll",
]
outputs = [
"$root_out_dir/{{source_file_part}}",
]
deps = [
gcp_portmon64_label,
]
if (symbol_level > 0) {
deps += [ ":copy_gcp_portmon_pdb" ]
}
}
}
source_set("lib") {
sources = [
"port_monitor.cc",
"port_monitor.h",
]
deps = [
"//base",
"//chrome/common:constants",
"//chrome/installer/launcher_support",
"//cloud_print/common",
"//cloud_print/virtual_driver/win",
]
}
process_version_rc_template("resources") {
sources = [
"../gcp_portmon_dll.ver",
]
# Note: target_gen_dir will be different for each toolchain so the output
# name doesn't need mangling.
output = "$target_gen_dir/gcp_portmon_dll.rc"
}