| # Copyright 2017 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| assert(current_os == "fuchsia") |
| |
| # Declare a driver module target. |
| # |
| # This target allows you to create an object file that can be used as a driver |
| # that is loaded at runtime. |
| # |
| # Flags: cflags, cflags_c, cflags_cc, asmflags, defines, include_dirs, |
| # ldflags, lib_dirs, libs, |
| # Deps: data_deps, deps, public_deps |
| # Dependent configs: all_dependent_configs, public_configs |
| # General: check_includes, configs, data, inputs, output_name, |
| # output_extension, public, sources, testonly, visibility |
| template("driver_module") { |
| loadable_module(target_name) { |
| _target_type = "driver_module" |
| |
| # Explicitly forward visibility, implicitly forward everything else. |
| # See comment in //build/config/BUILDCONFIG.gn for details on this pattern. |
| forward_variables_from(invoker, [ "visibility" ]) |
| forward_variables_from(invoker, "*", [ "visibility" ]) |
| } |
| } |
| |
| set_defaults("driver_module") { |
| # Sets the default configs for driver_module, which can be modified later |
| # by the invoker. This overrides the loadable_module default. |
| configs = default_shared_library_configs |
| |
| # In general, drivers should not use the C++ standard library, and drivers |
| # cannot dynamically link against it. This config tells the linker to not |
| # link against the C++ standard library. |
| # Drivers that do require standard library functionality should remove this |
| # config line and add "//build/config/fuchsia:static_cpp_standard_library" to |
| # statically link it into the driver. |
| configs += [ "//build/config/fuchsia:no_cpp_standard_library" ] |
| } |