cpp-lru-cache icon indicating copy to clipboard operation
cpp-lru-cache copied to clipboard

Project doesn't compile with Ninja

Open afiskon opened this issue 8 years ago • 2 comments

Steps to reproduce:

$ mkdir build
$ cd build
$ cmake -G Ninja ..
[...]
$ ninja
ninja: error: 'ext/gtest/src/googletest-build/libgtest.a', needed by 'cpp-lru-cache-test', missing and no known rule to make it

CMake version is 3.9.4, the environment is Arch Linux x64.

make compiles everything as expected. I believe something is wrong in ExternalProject_Add arguments. Unfortunately I can't give more details since I've never used ExternalProject before (I prefer git submodules).

afiskon avatar Oct 26 '17 10:10 afiskon

@afiskon I will have a look soon

lamerman avatar Oct 27 '17 20:10 lamerman

@afiskon what I understood so far is that for some reason with cmake -G Ninja .. it generates build.ninja with incompatible paths for static libraries.

So in the build file we have path ext/gtest/src/googletest-build/libgtest.a while in reality when ninja googletest is executed the path where static libraries are generated is ext/gtest/src/googletest-build/googlemock/gtest/libgtest.a

Moreover it somehow doesn't work if you don't execute ninja googletest before ninja.

Now it's all not clear for me, so let the task be open.

lamerman avatar Oct 31 '17 20:10 lamerman