Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cmake build script for math library #2774

Merged
merged 4 commits into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions math/gemmlowp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/gemmlowp
46 changes: 46 additions & 0 deletions math/gemmlowp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# ##############################################################################
# apps/math/gemmlowp/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you 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
#
# http://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.
#
# ##############################################################################

if(CONFIG_MATH_GEMMLOWP)

# ############################################################################
# Config and Fetch gemmlowp lib
# ############################################################################

set(GEMMLOWP_DIR ${CMAKE_CURRENT_LIST_DIR}/gemmlowp)

if(NOT EXISTS ${GEMMLOWP_DIR})
set(GEMMLOWP_URL
https://github.com/google/gemmlowp/archive/719139ce755a0f31cbf1c37f7f98adcc7fc9f425.zip
xiaoxiang781216 marked this conversation as resolved.
Show resolved Hide resolved
)
FetchContent_Declare(
gemmlowp_fetch
URL ${GEMMLOWP_URL} SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/gemmlowp
BINARY_DIR ${CMAKE_BINARY_DIR}/apps/math/gemmlowp/gemmlowp
DOWNLOAD_NO_PROGRESS true
TIMEOUT 30)

FetchContent_GetProperties(gemmlowp_fetch)

if(NOT gemmlowp_fetch_POPULATED)
FetchContent_Populate(gemmlowp_fetch)
endif()
endif()
endif()
1 change: 1 addition & 0 deletions math/kissfft/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/kissfft
74 changes: 74 additions & 0 deletions math/kissfft/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# ##############################################################################
# apps/math/kissfft/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you 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
#
# http://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.
#
# ##############################################################################

if(CONFIG_MATH_KISSFFT)

# ############################################################################
# Config and Fetch kissfft lib
# ############################################################################

set(KISSFFT_DIR ${CMAKE_CURRENT_LIST_DIR}/kissfft)

if(NOT EXISTS ${KISSFFT_DIR})
set(KISSFFT_URL
https://github.com/mborgerding/kissfft/archive/refs/tags/v130.zip)
xiaoxiang781216 marked this conversation as resolved.
Show resolved Hide resolved
FetchContent_Declare(
kissfft_fetch
URL ${KISSFFT_URL} SOURCE_DIR ${KISSFFT_DIR} BINARY_DIR
${CMAKE_BINARY_DIR}/apps/math/kissfft/kissfft
DOWNLOAD_NO_PROGRESS true
TIMEOUT 30)

FetchContent_GetProperties(kissfft_fetch)

if(NOT kissfft_fetch_POPULATED)
FetchContent_Populate(kissfft_fetch)

# Apply the patch after fetching the content
execute_process(
COMMAND ${CMAKE_COMMAND} -E echo "Applying patch to kissfft"
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})

execute_process(COMMAND patch -d ${KISSFFT_DIR} -p1 <
${CMAKE_CURRENT_LIST_DIR}/kissfft.patch)
endif()
endif()

# ############################################################################
# Sources
# ############################################################################

set(CSRCS ${KISSFFT_DIR}/kiss_fft.c ${KISSFFT_DIR}/tools/kiss_fftr.c)

# ############################################################################
# Include Directory
# ############################################################################

set(INCDIR ${CMAKE_CURRENT_LIST_DIR}/kissfft)

# ############################################################################
# Library Configuration
# ############################################################################

nuttx_add_library(kissfft STATIC)
target_sources(kissfft PRIVATE ${CSRCS})
target_include_directories(kissfft PUBLIC ${INCDIR})

endif()
1 change: 1 addition & 0 deletions math/ruy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/ruy
60 changes: 60 additions & 0 deletions math/ruy/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# ##############################################################################
# apps/math/ruy/CMakeLists.txt
#
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. The ASF licenses this
# file to you 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
#
# http://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.
#
# ##############################################################################

if(CONFIG_MATH_RUY)

# ############################################################################
# Config and Fetch ruy lib
# ############################################################################

set(RUY_DIR ${CMAKE_CURRENT_LIST_DIR}/ruy)

if(NOT EXISTS ${RUY_DIR})
set(RUY_URL
https://github.com/google/ruy/archive/d37128311b445e758136b8602d1bbd2a755e115d.zip
xiaoxiang781216 marked this conversation as resolved.
Show resolved Hide resolved
)
FetchContent_Declare(
ruy_fetch
URL ${RUY_URL} SOURCE_DIR ${RUY_DIR} BINARY_DIR
${CMAKE_BINARY_DIR}/apps/math/ruy/ruy
DOWNLOAD_NO_PROGRESS true
TIMEOUT 30)

FetchContent_GetProperties(ruy_fetch)

if(NOT ruy_fetch_POPULATED)
FetchContent_Populate(ruy_fetch)
endif()
endif()

# ############################################################################
# Include Directory
# ############################################################################

set(INCDIR ${CMAKE_CURRENT_LIST_DIR}/ruy)

# ############################################################################
# Library Configuration
# ############################################################################

nuttx_add_library(ruy STATIC)
target_include_directories(ruy PUBLIC ${INCDIR})

endif()
1 change: 1 addition & 0 deletions system/flatbuffers/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/flatbuffers
1 change: 1 addition & 0 deletions videoutils/openh264/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
openh264
Loading