| # 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("//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. |
| copy("copy_gcp_portmon_dll") { |
| if (is_clang) { |
| gcp_portmon64_toolchain = "//build/toolchain/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") |
| sources = [ |
| "$gcp_portmon64_out_dir/gcp_portmon64.dll", |
| ] |
| outputs = [ |
| "$root_out_dir/{{source_file_part}}", |
| ] |
| deps = [ |
| gcp_portmon64_label, |
| ] |
| } |
| } |
| |
| 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" |
| } |