Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
4885bbbd
Commit
4885bbbd
authored
9 years ago
by
Mark Charlebois
Browse files
Options
Downloads
Patches
Plain Diff
Added px4_mangle_name function to px4_base.cmake
Signed-off-by:
Mark Charlebois
<
charlebm@gmail.com
>
parent
e82ea34e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cmake/px4_base.cmake
+25
-0
25 additions, 0 deletions
cmake/px4_base.cmake
src/CMakeLists.txt
+0
-106
0 additions, 106 deletions
src/CMakeLists.txt
src/firmware/qurt/CMakeLists.txt
+2
-0
2 additions, 0 deletions
src/firmware/qurt/CMakeLists.txt
with
27 additions
and
106 deletions
cmake/px4_base.cmake
+
25
−
0
View file @
4885bbbd
...
...
@@ -610,4 +610,29 @@ function(px4_add_common_flags)
endfunction
()
#=============================================================================
#
# px4_mangle_name
#
# Convert a path name to a module name
#
# Usage:
# px4_mangle_name(dirname newname)
#
# Input:
# dirname : path to module dir
#
# Output:
# newname : module name
#
# Example:
# px4_mangle_name(${dirpath} mangled_name)
# message(STATUS "module name is ${mangled_name}")
#
function
(
px4_mangle_name dirname newname
)
set
(
tmp
)
string
(
REPLACE
"/"
"__"
tmp
${
dirname
}
)
set
(
${
newname
}
${
tmp
}
PARENT_SCOPE
)
endfunction
()
# vim: set noet fenc=utf-8 ff=unix nowrap:
This diff is collapsed.
Click to expand it.
src/CMakeLists.txt
+
0
−
106
View file @
4885bbbd
#=============================================================================
# module subdirectories, need to include first
#
add_subdirectory
(
./lib
)
add_subdirectory
(
./drivers
)
add_subdirectory
(
./platforms
)
...
...
@@ -8,108 +5,5 @@ add_subdirectory(./systemcmds)
add_subdirectory
(
./examples
)
add_subdirectory
(
./modules
)
add_subdirectory
(
./firmware
)
#=============================================================================
# executable
#
function
(
px4_mangle_name dirname newname
)
set
(
tmp
)
string
(
REPLACE
"/"
"__"
tmp
${
dirname
}
)
set
(
${
newname
}
${
tmp
}
PARENT_SCOPE
)
endfunction
()
if
(
${
OS
}
STREQUAL
"nuttx"
)
# a list of modules that will be linked to main
set
(
module_list
)
if
(
${
LABEL
}
STREQUAL
"simple"
)
list
(
APPEND module_list
drivers__led
drivers__device
platforms__common
modules__systemlib
modules__uORB
examples__px4_simple_app
lib__mathlib__math__filter
lib__conversion
)
endif
()
if
(
${
LABEL
}
STREQUAL
"simple"
)
list
(
APPEND module_list
${
module_list_simple
}
)
endif
()
list
(
APPEND module_list
platforms__nuttx
platforms__nuttx__px4_layer
drivers__boards__px4fmu-v2
drivers__stm32
)
px4_nuttx_generate_builtin_commands
(
OUT builtin_commands.c
MODULE_LIST
${
module_list
}
)
px4_nuttx_generate_romfs
(
OUT romfs.o
ROOT ROMFS/px4fmu_common
)
# add executable
add_executable
(
main builtin_commands.c romfs.o
)
set
(
nuttx_export_dir
${
CMAKE_BINARY_DIR
}
/
${
BOARD
}
/NuttX/nuttx-export
)
set
(
main_link_flags
"-T
${
nuttx_export_dir
}
/build/ld.script"
"-Wl,-Map=
${
CMAKE_BINARY_DIR
}
/main.map"
)
px4_join
(
OUT main_link_flags LIST
${
main_link_flags
}
GLUE
" "
)
set_target_properties
(
main PROPERTIES LINK_FLAGS
${
main_link_flags
}
)
target_link_libraries
(
main
-Wl,--start-group
${
module_list
}
apps nuttx nosys m gcc
-Wl,--end-group
)
px4_nuttx_add_firmware
(
OUT
${
CMAKE_CURRENT_BINARY_DIR
}
/fw_main.px4
EXE
${
CMAKE_CURRENT_BINARY_DIR
}
/main
)
px4_add_upload
(
OUT upload OS
${
OS
}
BOARD
${
BOARD
}
BUNDLE
${
CMAKE_CURRENT_BINARY_DIR
}
/fw_main.px4
)
elseif
(
${
OS
}
STREQUAL
"qurt"
)
set
(
V_ARCH v5
)
set
(
HEXAGON_TOOLS_ROOT /opt/6.4.03
)
set
(
TOOLSLIB
${
HEXAGON_TOOLS_ROOT
}
/dinkumware/lib/
${
V_ARCH
}
/G0
)
set
(
module_dir_list
)
set
(
module_list
)
px4_qurt_add_modules
(
module_dir_list
${
BOARD
}
)
message
(
STATUS
"module list:
${
module_dir_list
}
"
)
foreach
(
directory
${
module_dir_list
}
)
message
(
STATUS
"directory:
${
directory
}
"
)
px4_mangle_name
(
${
directory
}
mangled_name
)
list
(
APPEND module_list
${
mangled_name
}
)
endforeach
()
px4_qurt_generate_builtin_commands
(
OUT builtin_commands.cpp
MODULE_LIST
${
module_list
}
)
# FIXME @jgoppert - how to work around issues like this?
# Without changing global variables?
# Clear -rdynamic flag which fails for hexagon
set
(
CMAKE_SHARED_LIBRARY_LINK_C_FLAGS
""
)
set
(
CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS
""
)
add_executable
(
mainapp builtin_commands.cpp
)
target_link_libraries
(
mainapp
-Wl,--whole-archive
${
module_list
}
m
-Wl,--no-whole-archive
-Wl,
${
TOOLSLIB
}
/pic/libstdc++.a
)
endif
()
# vim: set noet ft=cmake fenc=utf-8 ff=unix :
This diff is collapsed.
Click to expand it.
src/firmware/qurt/CMakeLists.txt
+
2
−
0
View file @
4885bbbd
include
(
px4_base
)
set
(
V_ARCH v5
)
set
(
HEXAGON_TOOLS_ROOT /opt/6.4.03
)
set
(
TOOLSLIB
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment