| OLD | NEW |
| (Empty) | |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import("//chrome/process_version_rc_template.gni") |
| 6 |
| 7 assert(is_win) |
| 8 |
| 9 # When cross-compiling a 64-bit driver for a 32-bit build, some things get name |
| 10 # mangled with this suffix. |
| 11 if (target_cpu == "x86" && current_cpu == "x64") { |
| 12 arch_suffix = "64" |
| 13 } else { |
| 14 arch_suffix = "" |
| 15 } |
| 16 |
| 17 # When compiling a 64-bit port monitor from a 32-bit build, copy the DLL to the |
| 18 # root build directory. When targeting 64-bit CPUs, there is no cross-compiling |
| 19 # so nothing extra needs to happen. |
| 20 if (target_cpu == "x86" && current_cpu == "x64") { |
| 21 copy("port_monitor") { |
| 22 sources = [ |
| 23 "$root_out_dir/gcp_portmon64.dll", |
| 24 ] |
| 25 outputs = [ |
| 26 "$root_build_dir/gcp_portmon64.dll", |
| 27 ] |
| 28 deps = [ |
| 29 ":port_monitor_dll", |
| 30 ] |
| 31 } |
| 32 } else { |
| 33 group("port_monitor") { |
| 34 public_deps = [ |
| 35 ":port_monitor_dll", |
| 36 ] |
| 37 } |
| 38 } |
| 39 |
| 40 shared_library("port_monitor_dll") { |
| 41 output_name = "gcp_portmon$arch_suffix" |
| 42 |
| 43 sources = [ |
| 44 "port_monitor.def", |
| 45 "port_monitor_dll.cc", |
| 46 ] |
| 47 |
| 48 deps = [ |
| 49 ":lib", |
| 50 ":resources", |
| 51 "//base", |
| 52 "//chrome/common:constants", |
| 53 "//chrome/common:version_header", |
| 54 "//cloud_print/common", |
| 55 "//cloud_print/virtual_driver/win", |
| 56 ] |
| 57 |
| 58 libs = [ "userenv.lib" ] |
| 59 } |
| 60 |
| 61 source_set("lib") { |
| 62 sources = [ |
| 63 "port_monitor.cc", |
| 64 "port_monitor.h", |
| 65 ] |
| 66 |
| 67 deps = [ |
| 68 "//base", |
| 69 "//chrome/common:constants", |
| 70 "//chrome/installer/launcher_support", |
| 71 "//cloud_print/common", |
| 72 "//cloud_print/virtual_driver/win", |
| 73 ] |
| 74 } |
| 75 |
| 76 process_version_rc_template("resources") { |
| 77 sources = [ |
| 78 "../gcp_portmon${arch_suffix}_dll.ver", |
| 79 ] |
| 80 |
| 81 # Note: target_gen_dir will be different for each toolchain so the output |
| 82 # name doesn't need mangling. |
| 83 output = "$target_gen_dir/gcp_portmon_dll.rc" |
| 84 } |
| OLD | NEW |