Skip to content

Commit f841ca1

Browse files
zhangchao53xiaoxiang781216
authored andcommitted
enable superpi cmake
1 parent 7df20ea commit f841ca1

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

benchmarks/superpi/CMakeLists.txt

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# ##############################################################################
2+
# apps/benchmarks/superpi/CMakeList.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_BENCHMARK_SUPERPI)
22+
23+
set(SUPERPI_UNPACK ${CMAKE_CURRENT_LIST_DIR}/superpi)
24+
set(SUPERPI_URL https://github.com/Fibonacci43/SuperPI/archive)
25+
set(SUPERPI_ZIP main.zip)
26+
27+
if(NOT EXISTS ${SUPERPI_UNPACK})
28+
29+
FetchContent_Declare(
30+
superpi_fetch
31+
URL ${SUPERPI_URL}/${SUPERPI_ZIP} SOURCE_DIR ${SUPERPI_UNPACK} BINARY_DIR
32+
${CMAKE_BINARY_DIR}/apps/benchmarks/superpi/superpi
33+
DOWNLOAD_NO_PROGRESS true
34+
TIMEOUT 30)
35+
36+
FetchContent_GetProperties(superpi_fetch)
37+
if(NOT superpi_fetch_POPULATED)
38+
FetchContent_Populate(superpi_fetch)
39+
endif()
40+
41+
endif()
42+
43+
nuttx_add_application(
44+
NAME
45+
${CONFIG_BENCHMARK_SUPERPI_PROGNAME}
46+
STACKSIZE
47+
${CONFIG_BENCHMARK_SUPERPI_STACKSIZE}
48+
PRIORITY
49+
${CONFIG_BENCHMARK_SUPERPI_PRIORITY}
50+
SRCS
51+
${SUPERPI_UNPACK}/pi_fftcs.c
52+
${SUPERPI_UNPACK}/fftsg_h.c)
53+
54+
endif()

0 commit comments

Comments
 (0)