zephyr/cmake
Istvan Bisz 26e6162a82 cmake: Eclipse CDT4 generator amendment
1. The generator handles just the COMPILE_DEFINITIONS.
   (See: __ZEPHYR_SUPERVISOR__)
   For the defines in INTERFACE_COMPILE_DEFINITIONS
   a special handling is necessary.

   Solution:
   The amendment function generates a macro header file
   ${CMAKE_BINARY_DIR}/zephyr/include/generated/cmake_intdef.h
   based on INTERFACE_COMPILE_DEFINITIONS and appends the
   defines from the file to
   CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS.

2. Eclipse CDT4 indexer has problems with CMake 'Eclipse CDT4 - x'
   generator projects that use mixed C/C++.
   The Eclipse CDT4 indexer is showing a lot of unresolved symbol
   errors, when the project was created with CMake generator and
   the code is a mix of C and C++.
   The root cause of the problem is the g++ built-in __cplusplus macro,
   that is passed by CMake generator in the '.cproject' file.
   The defines in '.cproject' are always the same for C and C++.
   In mixed C/C++ projects, the header files often contain the following
   lines to let C++ code call the C functions:

   #ifdef __cplusplus
   extern "C" {
   #endif

   < header content >

   #ifdef __cplusplus
   }
   #endif

   Whenever the Eclipse CDT4 indexer compiles the code for
   code analysis, it has the macro __cplusplus set,
   independent of whether standard C or C++ source files are compiled.
   The 'extern "C"' confuses the standard C compilation and the indexer
   is messed up.

   Solution:
   The amendment function deletes the __cplusplus entry from
   CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS.

3. The amendment function appends the defines from
   ${CMAKE_BINARY_DIR}/zephyr/include/generated/autoconf.h to
   CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS.

Signed-off-by: Istvan Bisz <istvan.bisz@t-online.hu>
2018-10-17 18:16:55 -04:00
..
app cmake: Eclipse CDT4 generator amendment 2018-10-17 18:16:55 -04:00
compiler kconfig: Make CONIG_FP_SOFTABI generate floating point instructions 2018-09-19 10:13:30 -04:00
emu cmake: Fix 'run' command of native_posix 2018-10-16 10:50:29 -04:00
flash cmake: Add build system target for west attach command 2018-09-26 08:06:41 +05:30
ide cmake: Eclipse CDT4 generator amendment 2018-10-17 18:16:55 -04:00
reports scripts: fix ram_reports and generate bin file if missing 2018-01-29 05:16:52 +05:30
toolchain build: Replace GCC ARM Embedded with GNU Arm Embedded 2018-08-09 13:57:55 +02:00
usage cmake: Fall back to ZEPHYR_BASE when the board is not in BOARD_ROOT 2018-10-01 09:46:46 -04:00
util cmake: Rename process.cmake to reflect contents 2018-07-12 23:11:46 -04:00
ccache.cmake
dts.cmake cmake: Error-out when dts.fixup files are detected 2018-10-08 11:38:56 -04:00
extensions.cmake cmake: Fall back to ZEPHYR_BASE when the board is not in BOARD_ROOT 2018-10-01 09:46:46 -04:00
extra_flags.cmake cmake: Fix EXTRA_LDFLAGS feature 2017-12-05 08:39:43 -05:00
fpu-for-gcc-m-cpu.cmake cmake: indicate single precision floating-point for Cortex-M33 2018-02-23 21:42:22 -06:00
gcc-m-cpu.cmake arch: arm: update compile options for DSP 2018-07-03 12:17:13 -05:00
hex.cmake
host-tools-zephyr.cmake toolchain: require Zephyr SDK 0.9.3 2018-07-08 15:39:35 -04:00
host-tools.cmake build: Replace GCC ARM Embedded with GNU Arm Embedded 2018-08-09 13:57:55 +02:00
kconfig.cmake kconfig: Change the format of KERNELVERSION 2018-10-01 09:16:05 -04:00
kobj.cmake userspace: generate list of kernel object sizes 2018-05-16 17:32:59 -07:00
pristine.cmake
toolchain.cmake cmake: Support custom out-of-tree toolchains 2018-10-08 12:43:32 -04:00
version.cmake cmake: version: Misc. refactorings for readability 2018-10-01 09:16:05 -04:00