inja icon indicating copy to clipboard operation
inja copied to clipboard

Build inja_test failed.

Open wendajiang opened this issue 2 years ago • 2 comments

cmake -B build -S . -DCMAKE_BUILD_TYPE=Debug
cmake --build build -j2

output the

[ 33%] Building CXX object CMakeFiles/inja_test.dir/test/test.cpp.o
[ 33%] Building CXX object CMakeFiles/single_inja_test.dir/test/test.cpp.o
/Users/david/cpp/inja/test/test.cpp:5:10: fatal error: 'doctest/doctest.h' file not found
#include "doctest/doctest.h"
         ^~~~~~~~~~~~~~~~~~~
1 error generated.
gmake[2]: *** [CMakeFiles/inja_test.dir/build.make:76: CMakeFiles/inja_test.dir/test/test.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/inja_test.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
[ 50%] Linking CXX executable single_inja_test
[ 50%] Built target single_inja_test
gmake: *** [Makefile:146: all] Error 2

on Macos, and cmake version is 3.27.2

wendajiang avatar Aug 17 '23 03:08 wendajiang

This works for me and is tested on all platforms in CI. Are you sure that the file third_party/include/doctest/doctest.h exists?

pantor avatar Sep 03 '23 14:09 pantor

This works for me and is tested on all platforms in CI. Are you sure that the file third_party/include/doctest/doctest.h exists?

I look up the /CMakeLists.txt and the target inja_test not add the include directory. For comparison, the single_inja_test target have the target_include_directories(single_inja INTERFACE single_include include third_party/include)

And when add this line, it works for me. image

wendajiang avatar Sep 05 '23 05:09 wendajiang