emacscedet

CEDET cannot use GNU Global for Symref


I already enable using GNU Global databases:

(setq cedet-global-command "global")
(when (cedet-gnu-global-version-check t)
  (semanticdb-enable-gnu-global-databases 'c-mode t)
  (semanticdb-enable-gnu-global-databases 'c++-mode t))

cedet-gnu-global-version-check shows correct version and cedet-gnu-global-show-root jumps to correct project root. However, according to Eric's answer here: How can I tell if CEDET is using GNU Global?, evaluating (semantic-symref-detect-symref-tool) always gives me grep, even though CEDET recognized GNU Global version.

How can I really enable CEDET to use GNU Global?

Edit: I have to force CEDET to use GNU Global:

(setq-default semantic-symref-tool "global")

Not sure if this is a correct way to setup, but currently this is my workaround to make CEDET use GNU Global. Or maybe (semantic-symref-detect-symref-tool) is buggy?


Solution

  • In your edit, setting semantic-symref-tool to "global" is a fine way to start using it.

    The detect mechanism (the default) will try to use Global iff there is a GPATH file at the root of your project. The root of your project is identified via EDE, or perhaps the current directory. Thus if you have some project in ~/myproj, but GPATH is in ~/myproj/src, then it will get missed.