atilaneves / cmake-ide

Use Emacs as a C/C++ IDE
BSD 3-Clause "New" or "Revised" License
714 stars 92 forks source link

Reading compile_commands.json misreads includes #43

Closed tranner closed 8 years ago

tranner commented 8 years ago

I am having problems reading the compile_commands.json file. The compile command includes -I/home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-istl which is read as -I /home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dunestl (note the missing dune-istl has been read as dunestl near the end).

For example:

[
{
  "directory": "/home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/build-clang/dune-evolving-domains/src",
  "command": "/home/csunix/scstr/Software/anaconda/bin/clang++   -DENABLE_MPI=1 -DHAVE_CONFIG_H -DMPICH_SKIP_MPICXX -DMPIPP_H -O3 -Wall -Wno-unused-parameter -std=c++11  -I/home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/build-clang/dune-evolving-domains -I/home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-evolving-domains -I/usr/include/openmpi-x86_64 -I/home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-common -I/home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-geometry -I/home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-grid -I/home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-localfunctions -I/home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-istl -I/home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-alugrid -I/home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-fem    -o CMakeFiles/dune_evolving_domains.dir/dune_evolving_domains.cc.o -c /home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-evolving-domains/src/dune_evolving_domains.cc",
  "file": "/home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-evolving-domains/src/dune_evolving_domains.cc"
}
]

is read to give so that the output of flycheck-compile on dune_evolving_domains.cc as

clang -fsyntax-only -fno-color-diagnostics -fno-caret-diagnostics -fno-diagnostics-show-option -iquote /home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-evolving-domains/src/ -std\=c\+\+11 -Wall -Wextra -DENABLE_MPI\=1 -DHAVE_CONFIG_H -DMPICH_SKIP_MPICXX -DMPIPP_H -I /home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/build-clang/dune-evolving-domains -I /home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-evolving-domains -I /usr/include/openmpi-x86_64 -I /home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-common -I /home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-geometry -I /home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-grid -I /home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-localfunctions -I /home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dunestl -I /home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-alugrid -I /home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-fem -O3 -Wall -Wno-unused-parameter -o CMakeFiles/dune_evolving_domains.dir/dune_evolving_domains.cc.o -c -x c\+\+ - < /home/cserv1_a/soc_staff/scstr/Software/DUNE/dune-2.4/dune-evolving-domains/src/dune_evolving_domains.cc

This is with GNU Emacs 24.3.1 (x86_64-redhat-linux-gnu, GTK+ Version 3.14.13) of 2016-01-04 on CentOS Linux release 7.2.1511 (Core).

Any help is appreciated.

atilaneves commented 8 years ago

Will look into it.

tranner commented 8 years ago

Thanks for the swift resolution :+1: .