| # Copyright 2022 The Pigweed Authors |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| # use this file except in compliance with the License. You may obtain a copy of |
| # the License at |
| # |
| # https://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| # License for the specific language governing permissions and limitations under |
| # the License. |
| |
| import("//build_overrides/pigweed.gni") |
| |
| import("$dir_pw_arduino_build/arduino.gni") |
| import("$dir_pw_build/target_types.gni") |
| |
| if (pw_arduino_build_CORE_PATH != "") { |
| # Get c/c++ files for Adafruit_STMPE610 Arduino Library |
| _library_args = [ |
| "--library-path", |
| rebase_path( |
| "$pw_arduino_build_CORE_PATH/teensy/hardware/teensy/avr/libraries"), |
| "--library-names", |
| |
| "Adafruit_STMPE610", |
| ] |
| _library_c_files = exec_script( |
| arduino_builder_script, |
| arduino_show_command_args + _library_args + [ "--library-c-files" ], |
| "list lines") |
| _library_cpp_files = exec_script( |
| arduino_builder_script, |
| arduino_show_command_args + _library_args + [ "--library-cpp-files" ], |
| "list lines") |
| |
| # Get include directories |
| _library_include_only_args = [ |
| "--library-path", |
| rebase_path( |
| "$pw_arduino_build_CORE_PATH/teensy/hardware/teensy/avr/libraries"), |
| "--library-names", |
| "SPI", |
| "Wire", |
| "Adafruit_STMPE610", |
| ] |
| _library_include_dirs = |
| exec_script(arduino_builder_script, |
| arduino_show_command_args + _library_include_only_args + |
| [ "--library-include-dirs" ], |
| "list lines") |
| pw_source_set("pw_touchscreen_teensy_stmpe610") { |
| deps = [ |
| "$dir_pw_log", |
| "$dir_pw_third_party/arduino:arduino_core_sources", |
| "$dir_pw_touchscreen:pw_touchscreen.facade", |
| ] |
| sources = [ "touchscreen.cc" ] + _library_c_files + _library_cpp_files |
| include_dirs = _library_include_dirs |
| remove_configs = [ "$dir_pw_build:strict_warnings" ] |
| } |
| } |