Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Miosix Kernel
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
Container registry
Model registry
Operate
Environments
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Avionics
Software Development
Miosix Kernel
Commits
ec1254d4
Commit
ec1254d4
authored
1 year ago
by
Alberto Nidasio
Browse files
Options
Downloads
Patches
Plain Diff
Add checks to ensure that the `board_options.cmake` files defines all the required variables
parent
d6718f48
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
miosix/cmake/miosix_add_board_libraries.cmake
+28
-2
28 additions, 2 deletions
miosix/cmake/miosix_add_board_libraries.cmake
miosix/cmake/miosix_link_target.cmake
+1
-1
1 addition, 1 deletion
miosix/cmake/miosix_link_target.cmake
with
29 additions
and
3 deletions
miosix/cmake/miosix_add_board_libraries.cmake
+
28
−
2
View file @
ec1254d4
...
...
@@ -32,16 +32,42 @@
# - Miosix::boot-${BOARD_NAME}
# - Miosix::miosix-${BOARD_NAME}
function
(
miosix_add_board_libraries BOARD_OPTIONS_FILE
)
# Get board options and kernel sources
# The files are included here to scope all the variables
if
(
NOT KPATH
)
message
(
FATAL_ERROR
"KPATH must be defined to be the path to the miosix-kernel/miosix directory"
)
endif
()
include
(
${
BOARD_OPTIONS_FILE
}
)
include
(
${
KPATH
}
/cmake/kernel_sources.cmake
)
miosix_check_board_options_variables
()
miosix_add_interface_library
(
${
BOARD_NAME
}
)
miosix_add_boot_library
(
${
BOARD_NAME
}
)
miosix_add_miosix_library
(
${
BOARD_NAME
}
)
endfunction
()
# Aborts if the required variables to generate the libraries are missing
function
(
miosix_check_board_options_variables
)
set
(
VARIABLES
BOARD_NAME
ARCH_PATH
BOARD_PATH
BOARD_CONFIG_PATH
BOOT_FILE
LINKER_SCRIPT
AFLAGS
LFLAGS
CFLAGS
CXXFLAGS
ARCH_SRC
)
foreach
(
VARIABLE
${
VARIABLES
}
)
if
(
NOT DEFINED
${
VARIABLE
}
)
message
(
FATAL_ERROR
"You must define
${
VARIABLE
}
in your board_options.cmake file"
)
endif
()
endforeach
()
endfunction
()
# Adds an interface library with all the include directories and compile options needed to compile kernel code
function
(
miosix_add_interface_library BOARD_NAME
)
set
(
INTERFACE_LIB interface-
${
BOARD_NAME
}
)
...
...
This diff is collapsed.
Click to expand it.
miosix/cmake/miosix_link_target.cmake
+
1
−
1
View file @
ec1254d4
...
...
@@ -41,7 +41,7 @@ endfunction()
# Function to link the Miosix libraries to a target and register the build command
function
(
miosix_link_target TARGET OPT_BOARD
)
if
(
NOT OPT_BOARD
)
if
(
NOT
DEFINED
OPT_BOARD
)
message
(
FATAL_ERROR
"No board selected"
)
endif
()
...
...
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