|
| 1 | +# ############################################################################## |
| 2 | +# apps/math/ruy/CMakeLists.txt |
| 3 | +# |
| 4 | +# Licensed to the Apache Software Foundation (ASF) under one or more contributor |
| 5 | +# license agreements. See the NOTICE file distributed with this work for |
| 6 | +# additional information regarding copyright ownership. The ASF licenses this |
| 7 | +# file to you under the Apache License, Version 2.0 (the "License"); you may not |
| 8 | +# use this file except in compliance with the License. You may obtain a copy of |
| 9 | +# the License at |
| 10 | +# |
| 11 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | +# |
| 13 | +# Unless required by applicable law or agreed to in writing, software |
| 14 | +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 15 | +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 16 | +# License for the specific language governing permissions and limitations under |
| 17 | +# the License. |
| 18 | +# |
| 19 | +# ############################################################################## |
| 20 | + |
| 21 | +if(CONFIG_MATH_RUY) |
| 22 | + |
| 23 | + # ############################################################################ |
| 24 | + # Config and Fetch ruy lib |
| 25 | + # ############################################################################ |
| 26 | + |
| 27 | + set(RUY_DIR ${CMAKE_CURRENT_LIST_DIR}/ruy) |
| 28 | + |
| 29 | + if(NOT EXISTS ${RUY_DIR}) |
| 30 | + set(RUY_URL |
| 31 | + https://github.com/google/ruy/archive/d37128311b445e758136b8602d1bbd2a755e115d.zip |
| 32 | + ) |
| 33 | + FetchContent_Declare( |
| 34 | + ruy_fetch |
| 35 | + URL ${RUY_URL} SOURCE_DIR ${RUY_DIR} BINARY_DIR |
| 36 | + ${CMAKE_BINARY_DIR}/apps/math/ruy/ruy |
| 37 | + DOWNLOAD_NO_PROGRESS true |
| 38 | + TIMEOUT 30) |
| 39 | + |
| 40 | + FetchContent_GetProperties(ruy_fetch) |
| 41 | + |
| 42 | + if(NOT ruy_fetch_POPULATED) |
| 43 | + FetchContent_Populate(ruy_fetch) |
| 44 | + endif() |
| 45 | + endif() |
| 46 | + |
| 47 | + # ############################################################################ |
| 48 | + # Include Directory |
| 49 | + # ############################################################################ |
| 50 | + |
| 51 | + set(INCDIR ${CMAKE_CURRENT_LIST_DIR}/ruy) |
| 52 | + |
| 53 | + # ############################################################################ |
| 54 | + # Library Configuration |
| 55 | + # ############################################################################ |
| 56 | + |
| 57 | + nuttx_add_library(ruy STATIC) |
| 58 | + target_include_directories(ruy PUBLIC ${INCDIR}) |
| 59 | + |
| 60 | +endif() |
0 commit comments