Skip to content

Commit 4fdb389

Browse files
committed
Added support for building using idf.py.
Signed-off-by: Fred Dushin <[email protected]>
1 parent 23fb232 commit 4fdb389

File tree

1 file changed

+31
-8
lines changed

1 file changed

+31
-8
lines changed

CMakeLists.txt

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
1-
set(COMPONENT_SRCS
2-
driver/atomvm_dht.c
3-
)
1+
#
2+
# This file is part of AtomVM.
3+
#
4+
# Copyright 2022 Fred Dushin <[email protected]>
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#
18+
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later
19+
#
420

5-
set(COMPONENT_ADD_INCLUDEDIRS
6-
driver/include
7-
)
21+
set(ATOMVM_DHT_COMPONENT_SRCS
22+
"nifs/atomvm_dht.c"
23+
)
824

9-
set(COMPONENT_REQUIRES driver)
25+
idf_component_register(
26+
SRCS ${ATOMVM_DHT_COMPONENT_SRCS}
27+
INCLUDE_DIRS "nifs/include"
28+
PRIV_REQUIRES "libatomvm" "main"
29+
)
1030

11-
register_component()
31+
idf_build_set_property(
32+
LINK_OPTIONS "-Wl,--whole-archive ${CMAKE_CURRENT_BINARY_DIR}/lib${COMPONENT_NAME}.a -Wl,--no-whole-archive"
33+
APPEND
34+
)

0 commit comments

Comments
 (0)