Skip to content

Commit e2ae560

Browse files
committed
add handling of sub-dependencies, fix profile selection
1 parent c29945b commit e2ae560

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tools/export/cmake/CMakeLists.txt.tmpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ ADD_LIBRARY({{libname}} STATIC
5151
ADD_EXECUTABLE({{name}}
5252
{% for src in sources %}{{src}}
5353
{% endfor %})
54+
SET_TARGET_PROPERTIES({{name}} PROPERTIES ENABLE_EXPORTS 1)
5455
TARGET_LINK_LIBRARIES({{name}}
5556
{% for libname in dependencies.keys()|sort(reverse=true) %}{{libname}}
5657
{% endfor %})
@@ -89,8 +90,8 @@ ELSE()
8990
ENDIF()
9091

9192
# optional custom target to build via mbed-cli
92-
ADD_CUSTOM_TARGET(mbed-cli-build EXCLUDE_FROM_ALL
93-
COMMAND ${CMAKE_COMMAND} -E echo "mbed compile --build BUILD/${CMAKE_BUILD_TYPE} ${MBED_BUILD_PROFILE}"
93+
ADD_CUSTOM_TARGET(mbed-cli-build
94+
COMMAND ${CMAKE_COMMAND} -E echo "mbed compile --build BUILD/${CMAKE_BUILD_TYPE} --profile ${MBED_BUILD_PROFILE}"
9495
COMMAND mbed compile --build BUILD/${CMAKE_BUILD_TYPE} --profile ${MBED_BUILD_PROFILE}
9596
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
9697
SOURCES ${SOURCE_FILES} ${SYS_SOURCE_FILES})

tools/export/cmake/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def generate(self):
6767
# create a list of dependencies (mbed add ...)
6868
dependencies = [l[:-4] for l in self.resources.lib_refs]
6969
# separate the individual dependency source files into a map with the dep name as key and an array if files
70-
depSources = {re.sub(r'^[.]/', '', l):
70+
depSources = {re.sub(r'^[.]/', '', l).replace('/', '_'):
7171
sorted([f for f in allSourceFiles if f.startswith(l)]) for l in dependencies}
7272
# delete dependencies that have no source files (may happen if a sub-dependency is ignored by .mbedignore)
7373
depSources = {k: v for k, v in depSources.items() if len(v) != 0}

0 commit comments

Comments
 (0)