I want to write a clang tool that can run on C++ projects that I have that already exist which use Makefiles to build. The problem is, it seems as though any project that is going to be put through a clang AST must be built using cmake so that it can get a compile_commands.json file. Is there a way to do this for projects that don't use cmake? Or is there a way to build Makefile projects with cmake?
Asked
Active
Viewed 1,240 times
2
-
Why don't you use GNU Make for Windows? – tomas789 Oct 22 '13 at 18:22
-
`Or is there a way to build Makefile projects with cmake?` Mhm, `cmake` is used to create `Makefiles` for your project?! See here: http://stackoverflow.com/questions/395169/using-cmake-to-generate-visual-studio-c-project-files how to do it with Visual Studio... – Alexander Vogt Oct 22 '13 at 18:23
-
Some searching brought up [Bear](https://github.com/rizsotto/Bear), but that looks to be unix only. – David Brown Oct 22 '13 at 18:24
-
These projects run on both linux and windows, so I have no problem on the linux side of things because as David Brown mentioned, bear solves my problem there – slyslayer223 Oct 22 '13 at 18:45
1 Answers
2
You might be able to use this script with cygwin:
https://github.com/woboq/woboq_codebrowser/blob/master/scripts/fake_compiler.sh

steveire
- 10,694
- 1
- 37
- 48
-
Nice. That seems to be simplier than bear. Do you think it is better if you know what compiler is invoked anyway? – Johannes Schaub - litb Jul 25 '16 at 18:06
-
I'm afraid I don't know anything about bear. I have the luxury of using CMake all the time :). – steveire Jul 25 '16 at 18:41