1 2# Copyright 2019 The TensorFlow Authors. All Rights Reserved. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15 16# 17# This component was generated for the '%{EXECUTABLE}%' TF Micro example. 18# 19 20# Make sure that the IDF Path environment variable is defined 21if(NOT DEFINED ENV{IDF_PATH}) 22 message(FATAL_ERROR "The IDF_PATH environment variable must point to the location of the ESP-IDF.") 23endif() 24 25idf_component_register( 26 SRCS %{COMPONENT_SRCS}% 27 INCLUDE_DIRS %{COMPONENT_INCLUDES}%) 28 29# Reduce the level of paranoia to be able to compile TF sources 30target_compile_options(${COMPONENT_LIB} PRIVATE 31 -Wno-maybe-uninitialized 32 -Wno-missing-field-initializers 33 -Wno-type-limits) 34 35target_compile_options(${COMPONENT_LIB} PRIVATE %{CC_FLAGS}%) 36target_compile_options(${COMPONENT_LIB} PRIVATE $<$<COMPILE_LANGUAGE:CXX>: %{CXX_FLAGS}% >) 37target_compile_options(${COMPONENT_LIB} INTERFACE $<$<IN_LIST:-DTF_LITE_STATIC_MEMORY,$<TARGET_PROPERTY:${COMPONENT_LIB},COMPILE_OPTIONS>>:-DTF_LITE_STATIC_MEMORY>) 38target_link_libraries(${COMPONENT_LIB} PRIVATE %{LINKER_FLAGS}%) 39