| # Copyright 2018 The Chromium OS 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("//common-mk/generate-dbus-adaptors.gni") |
| import("//common-mk/pkg_config.gni") |
| |
| group("all") { |
| deps = [ |
| ":smbproviderd", |
| ] |
| if (use.test) { |
| deps += [ ":smbprovider_test" ] |
| } |
| if (use.fuzzer) { |
| deps += [ ":netbios_packet_fuzzer" ] |
| } |
| } |
| |
| pkg_config("target_defaults") { |
| pkg_deps = [ |
| "libbrillo-${libbase_ver}", |
| "libchrome-${libbase_ver}", |
| "libpasswordprovider", |
| "smbclient", |
| |
| # system_api depends on protobuf (or protobuf-lite). It must |
| # appear before protobuf or the linker flags won"t be in the right |
| # order. |
| "system_api", |
| ] |
| if (use.fuzzer) { |
| pkg_deps += [ "protobuf" ] |
| } else { |
| pkg_deps += [ "protobuf-lite" ] |
| } |
| } |
| |
| generate_dbus_adaptors("smbproviderd_adaptors") { |
| dbus_adaptors_out_dir = "include/dbus_adaptors" |
| dbus_service_config = "dbus_bindings/dbus-service-config.json" |
| new_fd_bindings = true |
| sources = [ |
| "dbus_bindings/org.chromium.SmbProvider.xml", |
| ] |
| } |
| |
| static_library("libsmbprovider") { |
| configs += [ ":target_defaults" ] |
| deps = [ |
| ":smbproviderd_adaptors", |
| ] |
| sources = [ |
| "authpolicy_kerberos_artifact_client.cc", |
| "authpolicy_kerberos_artifact_client.h", |
| "constants.cc", |
| "constants.h", |
| "copy_progress_interface.h", |
| "file_copy_progress.cc", |
| "file_copy_progress.h", |
| "id_map.h", |
| "iterator/caching_iterator.h", |
| "iterator/depth_first_iterator.cc", |
| "iterator/depth_first_iterator.h", |
| "iterator/directory_iterator.cc", |
| "iterator/directory_iterator.h", |
| "iterator/post_depth_first_iterator.cc", |
| "iterator/post_depth_first_iterator.h", |
| "iterator/pre_depth_first_iterator.cc", |
| "iterator/pre_depth_first_iterator.h", |
| "iterator/share_iterator.h", |
| "kerberos_artifact_client_interface.h", |
| "kerberos_artifact_synchronizer.cc", |
| "kerberos_artifact_synchronizer.h", |
| "kerberos_kerberos_artifact_client.cc", |
| "kerberos_kerberos_artifact_client.h", |
| "metadata_cache.cc", |
| "metadata_cache.h", |
| "mount_manager.cc", |
| "mount_manager.h", |
| "mount_tracker.cc", |
| "mount_tracker.h", |
| "netbios_packet_parser.cc", |
| "netbios_packet_parser.h", |
| "proto.cc", |
| "proto.h", |
| "read_dir_progress.cc", |
| "read_dir_progress.h", |
| "recursive_copy_progress.cc", |
| "recursive_copy_progress.h", |
| "samba_interface.h", |
| "samba_interface_impl.cc", |
| "samba_interface_impl.h", |
| "smbprovider.cc", |
| "smbprovider.h", |
| "smbprovider_helper.cc", |
| "smbprovider_helper.h", |
| "temp_file_manager.cc", |
| "temp_file_manager.h", |
| ] |
| } |
| |
| executable("smbproviderd") { |
| configs += [ ":target_defaults" ] |
| deps = [ |
| ":libsmbprovider", |
| ] |
| sources = [ |
| "smbprovider_main.cc", |
| ] |
| libs = [ "installattributes-${libbase_ver}" ] |
| } |
| |
| # Unit tests. |
| if (use.test) { |
| pkg_config("smbprovider_test_config") { |
| pkg_deps = [ "libchrome-test-${libbase_ver}" ] |
| } |
| executable("smbprovider_test") { |
| configs += [ |
| "//common-mk:test", |
| ":target_defaults", |
| ] |
| deps = [ |
| ":libsmbprovider", |
| "//common-mk/testrunner:testrunner", |
| ] |
| sources = [ |
| "fake_kerberos_artifact_client.cc", |
| "fake_kerberos_artifact_client.h", |
| "fake_samba_interface.cc", |
| "fake_samba_interface.h", |
| "fake_samba_proxy.cc", |
| "fake_samba_proxy.h", |
| "fake_samba_test.cc", |
| "file_copy_progress_test.cc", |
| "id_map_test.cc", |
| "iterator/caching_iterator_test.cc", |
| "iterator/depth_first_iterator_test.cc", |
| "iterator/directory_iterator_test.cc", |
| "iterator/post_depth_first_iterator_test.cc", |
| "iterator/pre_depth_first_iterator_test.cc", |
| "iterator/share_iterator_test.cc", |
| "kerberos_artifact_synchronizer_test.cc", |
| "metadata_cache_test.cc", |
| "mount_manager_test.cc", |
| "mount_tracker_test.cc", |
| "netbios_packet_parser_test.cc", |
| "proto_test.cc", |
| "read_dir_progress_test.cc", |
| "recursive_copy_progress_test.cc", |
| "smbprovider_helper_test.cc", |
| "smbprovider_test.cc", |
| "smbprovider_test_helper.cc", |
| "smbprovider_test_helper.h", |
| "temp_file_manager_test.cc", |
| ] |
| } |
| } |
| |
| # Fuzzer target. |
| if (use.fuzzer) { |
| executable("netbios_packet_fuzzer") { |
| configs += [ |
| "//common-mk/common_fuzzer:common_fuzzer", |
| ":target_defaults", |
| ] |
| deps = [ |
| ":libsmbprovider", |
| ] |
| sources = [ |
| "netbios_packet_fuzzer.cc", |
| ] |
| } |
| } |