Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
0fabda31
Commit
0fabda31
authored
Apr 08, 2021
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py/py.cmake: Move qstr helper code to micropy_gather_target_properties.
Signed-off-by:
Damien George
<
damien@micropython.org
>
parent
7b41d7f1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
38 deletions
+25
-38
ports/esp32/main/CMakeLists.txt
ports/esp32/main/CMakeLists.txt
+1
-16
ports/rp2/CMakeLists.txt
ports/rp2/CMakeLists.txt
+2
-22
py/py.cmake
py/py.cmake
+22
-0
No files found.
ports/esp32/main/CMakeLists.txt
View file @
0fabda31
...
...
@@ -170,22 +170,7 @@ target_link_libraries(${MICROPY_TARGET} usermod)
# Collect all of the include directories and compile definitions for the IDF components.
foreach
(
comp
${
IDF_COMPONENTS
}
)
get_target_property
(
type __idf_
${
comp
}
TYPE
)
set
(
_inc OFF
)
set
(
_def OFF
)
if
(
${
type
}
STREQUAL STATIC_LIBRARY
)
get_target_property
(
_inc __idf_
${
comp
}
INCLUDE_DIRECTORIES
)
get_target_property
(
_def __idf_
${
comp
}
COMPILE_DEFINITIONS
)
elseif
(
${
type
}
STREQUAL INTERFACE_LIBRARY
)
get_target_property
(
_inc __idf_
${
comp
}
INTERFACE_INCLUDE_DIRECTORIES
)
get_target_property
(
_def __idf_
${
comp
}
INTERFACE_COMPILE_DEFINITIONS
)
endif
()
if
(
_inc
)
list
(
APPEND MICROPY_CPP_INC_EXTRA
${
_inc
}
)
endif
()
if
(
_def
)
list
(
APPEND MICROPY_CPP_DEF_EXTRA
${
_def
}
)
endif
()
micropy_gather_target_properties
(
__idf_
${
comp
}
)
endforeach
()
if
(
IDF_VERSION_MINOR GREATER_EQUAL 2
)
...
...
ports/rp2/CMakeLists.txt
View file @
0fabda31
...
...
@@ -193,29 +193,9 @@ add_custom_command(TARGET ${MICROPY_TARGET}
)
# Collect all the include directories and compile definitions for the pico-sdk components.
macro
(
_process_target targ
)
if
(
TARGET
${
targ
}
)
get_target_property
(
type
${
targ
}
TYPE
)
set
(
_inc OFF
)
set
(
_def OFF
)
if
(
${
type
}
STREQUAL STATIC_LIBRARY
)
get_target_property
(
_inc
${
targ
}
INCLUDE_DIRECTORIES
)
get_target_property
(
_def
${
targ
}
COMPILE_DEFINITIONS
)
elseif
(
${
type
}
STREQUAL INTERFACE_LIBRARY
)
get_target_property
(
_inc
${
targ
}
INTERFACE_INCLUDE_DIRECTORIES
)
get_target_property
(
_def
${
targ
}
INTERFACE_COMPILE_DEFINITIONS
)
endif
()
if
(
_inc
)
list
(
APPEND MICROPY_CPP_INC_EXTRA
${
_inc
}
)
endif
()
if
(
_def
)
list
(
APPEND MICROPY_CPP_DEF_EXTRA
${
_def
}
)
endif
()
endif
()
endmacro
()
foreach
(
comp
${
PICO_SDK_COMPONENTS
}
)
_process_target
(
${
comp
}
)
_process_target
(
${
comp
}
_headers
)
micropy_gather_target_properties
(
${
comp
}
)
micropy_gather_target_properties
(
${
comp
}
_headers
)
endforeach
()
# Include the main MicroPython cmake rules.
...
...
py/py.cmake
View file @
0fabda31
...
...
@@ -122,3 +122,25 @@ set(MICROPY_SOURCE_PY
${
MICROPY_PY_DIR
}
/vstr.c
${
MICROPY_PY_DIR
}
/warning.c
)
# Helper macro to collect include directories and compile definitions for qstr processing.
macro
(
micropy_gather_target_properties targ
)
if
(
TARGET
${
targ
}
)
get_target_property
(
type
${
targ
}
TYPE
)
set
(
_inc OFF
)
set
(
_def OFF
)
if
(
${
type
}
STREQUAL STATIC_LIBRARY
)
get_target_property
(
_inc
${
targ
}
INCLUDE_DIRECTORIES
)
get_target_property
(
_def
${
targ
}
COMPILE_DEFINITIONS
)
elseif
(
${
type
}
STREQUAL INTERFACE_LIBRARY
)
get_target_property
(
_inc
${
targ
}
INTERFACE_INCLUDE_DIRECTORIES
)
get_target_property
(
_def
${
targ
}
INTERFACE_COMPILE_DEFINITIONS
)
endif
()
if
(
_inc
)
list
(
APPEND MICROPY_CPP_INC_EXTRA
${
_inc
}
)
endif
()
if
(
_def
)
list
(
APPEND MICROPY_CPP_DEF_EXTRA
${
_def
}
)
endif
()
endif
()
endmacro
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment