KDAB / codebrowser

Woboq CodeBrowser
http://woboq.com/codebrowser.html
Other
1.1k stars 161 forks source link

Error: The file was not recognized as source code #47

Open shizhx opened 8 years ago

shizhx commented 8 years ago

Android NDK project: https://github.com/googlesamples/android-ndk/tree/66d64b4710291f289c05c52abdb0e2650af0f6f2/hello-jni execute bear ndk-build to generate compile_commands.json, here is it's content:

[
    {
        "command": "cc -c -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -mthumb -Os -g -DNDEBUG -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -O0 -UNDEBUG -marm -fno-omit-frame-pointer -I/home/hsz/labs/test/cmake_android/hello-jni/jni -DANDROID -Wa,--noexecstack -Wformat -Werror=format-security -I/home/hsz/App/android-ndk-r10e/platforms/android-3/arch-arm/usr/include -o /home/hsz/labs/test/cmake_android/hello-jni/obj/local/armeabi/objs-debug/hello-jni/hello-jni.o /home/hsz/labs/test/cmake_android/hello-jni/jni/hello-jni.c", 
        "directory": "/home/hsz/labs/test/cmake_android/hello-jni/jni", 
        "file": "/home/hsz/labs/test/cmake_android/hello-jni/jni/hello-jni.c"
    }
]

then I execute these commands:

OUTPUTDIRECTORY=~/public_html/hello-jni
DATADIRECTORY=$OUTPUTDIRECTORY/../data
BUILDIRECTORY=~/labs/test/cmake_android/hello-jni/jni
VERSION=test
./generator/codebrowser_generator -b $BUILDIRECTORY -a -o $OUTPUTDIRECTORY -p codebrowser:$BUILDIRECTORY:$VERSION

and get this error:

Error: The file was not recognized as source code: /home/hsz/labs/test/cmake_android/hello-jni/jni/hello-jni.c

what can I do to resolve this error?

shizhx commented 8 years ago

I tried to edit the compile_commands.json and remove some compile options, content become:

[
    {
        "command": "cc -c -fpic -I/home/hsz/labs/test/cmake_android/hello-jni/jni -DANDROID -I/home/hsz/App/android-ndk-r10e/platforms/android-3/arch-arm/usr/include -o /home/hsz/labs/test/cmake_android/hello-jni/obj/local/armeabi/objs-debug/hello-jni/hello-jni.o /home/hsz/labs/test/cmake_android/hello-jni/jni/hello-jni.c", 
        "directory": "/home/hsz/labs/test/cmake_android/hello-jni/jni", 
        "file": "/home/hsz/labs/test/cmake_android/hello-jni/jni/hello-jni.c"
    }
]

and that error disappeared……

ogoffart commented 8 years ago

The problem seems to be the -march=armv5te which is not supported by clang, and then it bails out. I don't really know how to fix this problem. I can't simply filter out the -march because it might impact some ifdef for supported arch.

guruz commented 5 years ago

@shizhx Any news?