Commit Graph

27 Commits

Author SHA1 Message Date
Anna Lyons
bc61a7f3bd python2 --> python3
Update all scripts and build system to call python3, given python2's
upcoming doom. Use sys.maxsize instead of sys.maxint in one script
(maxint does not exist in python3).
2019-08-08 10:19:24 +10:00
Kent McLeod
82f2d1fc9c helpers.cmake: Add FORCE to all INTERNAL sets
INTERNAL implies FORCE but in some versions of CMake if a config option
has been passed in via a -D option the INTERNAL set doesn't override the
value when it should.

See: https://gitlab.kitware.com/cmake/cmake/issues/19015
  INTERNAL does not imply FORCE for CACHE
2019-06-27 18:29:55 +10:00
Kent McLeod
3707f65c6f CMake: Refactor DTS compilation step in CMake
- Minimise calls to external_process as this is more expensive than
using built-in CMake file operations.
- Update check_outfile_stale to also save the list of files it checks
for stale checks so if a config changes the list of files then the
output file will still be stale even if the input list of files are
older than it.
2019-05-07 10:15:54 +10:00
Kent McLeod
9db06db088 CMake: Remove unused cmake module import
While some functionality in helpers.cmake is based on
CMakeDependentOption, this module isn't actually used.
2019-05-07 10:00:08 +10:00
Anna Lyons
ffa9fda8f0 style: use consistent styling for all cmake files
Add .cmake-format.yaml which defines custom functions with kwargs to
style nicely
2019-03-22 11:52:06 +11:00
Anna Lyons
86ed25b8c0 cmake: use snake_case for RegisterDriver & CPPFile
Our upcoming cmake styling tool requires any custom functions you want
styled nicely to be lower case. We only need to style these two nicely,
as they have kwargs we would like aligned.
2019-03-22 11:50:04 +11:00
Kent McLeod
0cc4997a16 cmake: add check_outfile_stale macro
This checks if a file is older than other files during CMake configure
phase. This is to prevent unnecessary long running execute_process
calls.
2019-03-12 08:55:05 +11:00
Anna Lyons
eceefa883d cmake: add kernel platform helpers.
Add kernel_platforms_string and kernel_platforms_list to tools/helpers.cmake.
kernel_platforms_string: concatenates all platform strings together into a
newline separated string.
kernel_platforms_list: returns a list of all kernel platforms.
2018-12-10 16:36:22 +11:00
Kent McLeod
02c9895f66 CMake: Add missing dependency to CPPFile function 2018-09-03 11:11:51 +10:00
Adam Felizzi
43b7bca872 CMake: CPPFile EXACT_NAME creates a temp copy
Modified the behaviour of the EXACT_INPUT option within the
CPPFile helper function. Now named EXACT_NAME, the option
copies the input file to a temporary file. The name of the
temporary file is also passed in by the caller. This
step in necessary in getting the CPP step to correctly
depend on the targets given by the caller
(through EXTRA_DEPS). Also updated the CPP generation of the
kernel_all.i file to reflect the change.
2018-08-27 10:18:10 +10:00
Kent McLeod
639b7fbd37 CMake: Add get_absolute_list_source_or_binary
This function checks CMAKE_CURRENT_LIST_DIR and then calls
get_absolute_source_or_binary if the file wasn't found
2018-07-24 15:00:21 +10:00
Corey Lewis
b50c6a86df cmake: Use ABSOLUTE instead of REALPATH
REALPATH was unnecessary and results in resolving symlinks in the target, although
the working directory will not have its symlink resolved. This results in very strange
paths from the base directory (which is the working directory) to the target.
2018-04-04 15:51:45 +10:00
Adrian Danis
ccac858da8 cmake: Remove GenCPPCommand
This helper was ugly when written and simply should not be used over the CPPFile helper.
2018-02-22 14:51:48 +11:00
Adrian Danis
a19a2b3b8d cmake: CPPFile New helper for just pre-processing files
This is a new version of GenCPPCommand that uses an OBJECT library intermediate to get
cmake to do 'arbitrary' compilation (by adding the -E flag) where the result does not
need to be linkable. The advantage of this over the GenCPPCommand version is there is
no need for trying to manually invoke GCC with all the correct arguments lists.
2018-02-22 14:51:48 +11:00
Adrian Danis
118a7869f4 cmake: get_absolute_source_or_binary is a function
As a macro this helper would not operate as expected if output and input were defined
as the same variable. Making a function and explicitly writing into the PARENT_SCOPE
fixes this and also makes the code simpler
2018-02-22 14:51:48 +11:00
Adrian Danis
4b8a3e24d2 config: Reset options to default when enabled
This change makes values take on more intuitive and expected defaults when gradually
configuring the kernel, either programatically or through the graphic interfaces
2018-02-07 11:49:28 +11:00
Kent McLeod
33192cd8ae cmake config_choice: save options in cache var
This is to make it possible to enumerate all config options instead of
just the 'valid' ones that are saved as the STRINGS property.
2018-02-01 15:11:43 +11:00
Adrian Danis
9a89cbe4c6 cmake: TOPLEVELTYPES declared as target property
TOPLEVELTYPES is not intended to be configurable by the user, rather is a reflection
on the types defined by the source. This changes the TOPLEVELTYPES argument to be
a property, allowing it to be constructed as a generator expression when generating
BF files. By being a property, and not something like a global property, it removes
the need to ensure that additions to TOPLEVELTYPES are done prior to any bitfield
target definitions.
2017-11-15 17:33:13 +11:00
Adrian Danis
a2c8462efb cmake: Expand lists in BF generation
Uses the COMMAND_EXPAND_LISTS flag to allow for generator expressions in parameters
to GenBFCommand. As lists are now being expanded the 'args' variable must also be
quoted.
2017-11-15 17:33:13 +11:00
Adrian Danis
aa3fc06c79 cmake: Make variables show up if previously hidden
Previously if a variable had unmet dependencies and had been hidden, by being made
an internal variable, it would not have been unhidden by the use of `option`. This
emulates the behaviour of `option` that we were wanting, but additionally using `FORCE`
to override the `INTERNAL` setting
2017-11-03 16:39:45 +11:00
Adrian Danis
24a69963e7 cmake: Directly generate configuration files
Uses file(GENERATE) to directly create the contents of generated configuration files instead of
awkwardly using custom commands to echo the contents of multi line strings into files.
2017-11-03 13:49:37 +11:00
Adrian Danis
89fb678db8 cmake: Invoke compilations without echo and xargs
Newer versions of cmake provide a COMMAND_EXPAND_LISTS option that allows a quoted string,
such as "a;b" to be given to a COMMAND parameter and have it expand into multiple arguments.
Using this we can much more nicely generate some of our COMMAND invocations, at the cost of
requiring a more recent cmake version
2017-11-03 13:49:37 +11:00
Gerwin Klein
38cc67e821 slightly more Mac friendly cmake commands
Mac has BSD sed, not GNU sed; tr seems to be more portable.
2017-11-02 13:39:13 +11:00
Adrian Danis
3a48b9fa33 cmake: Unset CACHE variables from the CACHE
These variables were meant to be removed from the cache
2017-10-27 14:13:31 +11:00
Adrian Danis
777f19645b cmake: Correctly set options to their DEFAULT_DISABLED values
The config_option helper was previously using cmake_dependent_option, which supposedly took
a value to set the option to in the case where it was disabled. However, this only sets
the value in the current function context, and not the cache. I do not understand why this
is the case and it seems to make that functionality completely useless. This commit simply
does the dependency checking itself and correctly sets the disabled value.
2017-10-27 14:13:05 +11:00
Adrian Danis
eac4f6bfa2 proof: Defer theory dependencies to isabelle
Instead of explicitly depending on Kernel_C.thy prior to generating proofs, this removes
the dependency check and leaves isabelle to check the dependency upon import.
2017-09-20 14:22:14 +10:00
Adrian Danis
0b73072016 Add a CMake based build system
This commit adds an alternate build system using CMake that operates indepenently of
the existing Kconfig+Kbuild+make based build system
2017-08-22 13:56:26 +10:00