Add support for compiling FW with settings acceptable for clang,
in order to let it perform static analysis on the code.
Clang works mostly on ASTs made out of C code, so there is
no need to build complete signed binary for it.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Command git describe looks only for annotated tags, but we should
get any tag reachable from master, that's why --tags flag is needed.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Unify calls for compiler version and name for XCC and GCC.
Separate conversion of optimization level from Kconfig settings
to compiler flags to separate cmake function, because of usage
in two places.
Read XCC_TOOLS_VERSION from compiler.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Add helper function sof_append_relative_path_definitions that
defines RELATIVE_PATH per source file for given target.
__FILE is not always suitable as C standard states that __FILE__ expands to
input file name, that usually is absolute path what will cause f.e. .rodata
size to be dependent on where project is physically located on the disk.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
When there are changes made to Kconfig files it's better
to run olddefconfig automatically to prevent undesired behaviour,
like for example depending on added config that has some default value
that is not present because developer didn't run olddefconfig
after pulling changes.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Adding static libraries properly may be troublesome for developers
that are not familiar with CMake, so function that makes it easier
should be useful.
Usually developer will just add sources directly to the target.
Using static libraries should be limited just to closed / precompiled
3rd party components.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
CMake has convention of changing relative paths to absolute
for CMAKE_* variables. It does it automatically f.e. CMAKE_C_COMPILER.
However for our tools like objcopy we have to do it manually.
It also helps with integration of CMake in some IDEs.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>