Parser issue?

Leon Pollak leonp at plris.com
Thu Oct 16 18:18:47 BST 2014


Hello, all.

It seems that code browser/parser does not see correctly the definitions 
dependent on the variables defined in cmake file. I understand the complexity 
of the issue next to impossible.
Still, may be kdevelop gurus may be so kind to suggest something to solve 
this?
---
I have the same code for several different architectures. Thus I have build 
dirs for each CPU type named as BuildARM, BuildPPC, BuildPC, etc...
My cmake.txt contains:

#define build type XXX: /Projects/CSU/BuildXXX
string(REPLACE "/" ";" LIST ${CMAKE_BINARY_DIR})
list(GET LIST 3 BUILD_TYPE)
if (BUILD_TYPE MATCHES BuildPC)
add_definitions(-DBUILD_PC)
elseif (BUILD_TYPE MATCHES BuildARM2)
add_definitions(-DBUILD_ARM2)
elseif (BUILD_TYPE MATHES BuildPPC)
add_definitions(-DBUILD_PPC)
elseif (BUILD_TYPE MATCHES BuildARM)
add_definitions(-DBUILD_ARM)
endif()


There is also main system.h file which contains:

#ifdef BUILD_PC
#define BUILD_ARM
#endif

#ifdef BUILD_ARM
#include "system-DVRM.h"
#elif defined(BUILD_PPC)
#include "system-TDR.h"
#elif defined(BUILD_ARM2)
#include "system-HDVR.h"
#endif
#if !defined(SYS_CPU)
#error No CPU definition
#endif

(for accuracy - I debug some code in PC for different configurations, in the 
example - for ARM).

What is unclear to me, that parser for some reason ALWAYS(!!!) thinks that 
only variable BUILD_PPC is defined! Independent of what configuration is 
chosen, it always thinks that BUILD_PPC is defined.
I tried to delete all ~.cache and ~.ccashe directories, rebuild DB, recompile 
- nothing helps! Only BUILD_PPC is defined all the time.

Is there any way to get out of this?

Many thanks ahead.
-- 
Leon



More information about the KDevelop mailing list