spico
spico

Reputation: 111

Error building : depfile has multiple output paths ninja: build stopped: subcommand failed

I got this error while building a Java project with JNI code that needs CMake support. This project is built with Android Studio, with the support of NDK, CMake and LLVM. These are the flags below that CMake uses. I actually used C++ code from a project created as a C++ project and included it in mine. The build chain is way too complicated for me I guess. I got this error form Ninja.

FAILED: CMakeFiles/RoyaleCameraJNI.dir/src/main/jni/RoyaleCameraJNI.cpp.o /$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ --target=aarch64-none-linux-android21 --gcc-toolchain=$HOME/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64 -DRoyaleCameraJNI_EXPORTS -DTARGET_PLATFORM_ANDROID -I../../../../src/main/jniLibs/arm64-v8a/include -Wno-inconsistent-missing-override -std=gnu++11 -MD -MT -MF -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -fno-addrsig -Wa,--noexecstack -Wformat -Werror=format-security -stdlib=libc++ -O0 -fPIC -O0 -fno-limit-debug-info -fPIC -std=gnu++11 -MD -MT CMakeFiles/RoyaleCameraJNI.dir/src/main/jni/RoyaleCameraJNI.cpp.o -MF CMakeFiles/RoyaleCameraJNI.dir/src/main/jni/RoyaleCameraJNI.cpp.o.d -o CMakeFiles/RoyaleCameraJNI.dir/src/main/jni/RoyaleCameraJNI.cpp.o -c ../../../../src/main/jni/RoyaleCameraJNI.cpp depfile has multiple output paths ninja: build stopped: subcommand failed.

Please help, if there is any workaround...

Upvotes: 3

Views: 2497

Answers (1)

owford
owford

Reputation: 91

In my case, the reason for this error message was because my sources paths contained %. Changing them to _ solved my problem.

In your case, it looks more like the discussion here

Ninja canonicalizes file paths from GCC-style dependency files without querying the filesystem. This breaks when symbolic links are combined with ".." components (as produced by Clang)

Unfortunately, no correction was merged, but you may try removing either symbolic links or ".." from your paths.

Upvotes: 4

Related Questions