Closed emoon closed 8 years ago
Did you use -d
flag to specify QtCore dependency? It will not work without -d
because QSyntaxHighlighter
's pure virtual function uses QString
and QString
is declared in QtCore, so the function will be skipped and the generator will not know that it's an abstract class.
This commit seems to fix OSX support and passes on Travis. You can try to run tests/travis.bash
on your local machine.
Ah. I didn't use the -d
flag no. What is the exact command line I should use? (edit: nm, I see it now in the build script) I will try out the travis script. Thanks!
I still run into issues when trying this on my machine
C++ library name: Qt5Core
Detecting Qt directories...
Executing command: "qmake" "-query" "QT_INSTALL_HEADERS"
/Users/danielcollin/Qt5.7.0/include
QT_INSTALL_HEADERS = "/Users/danielcollin/Qt5.7.0/include"
Executing command: "qmake" "-query" "QT_INSTALL_LIBS"
/Users/danielcollin/Qt5.7.0/lib
QT_INSTALL_LIBS = "/Users/danielcollin/Qt5.7.0/lib"
Building without Qt doc data (no env var: QT5CORE_DOC_DATA)
Parsing C++ headers.
clang version 3.8.0 (tags/RELEASE_380/final)
Initializing clang...
clang arguments: ["-fPIC", "-fcxx-exceptions", "-std=gnu++11", "-Xclang", "-detailed-preprocessing-record", "-I", "/Users/danielcollin/Qt5.7.0/include", "-I", "/Users/danielcollin/Qt5.7.0/lib/QtCore.framework/Headers", "-isystem", "/Users/danielcollin/clang-3.8/lib/clang/3.8.0/include", "-F", "/Users/danielcollin/Qt5.7.0/lib"]
Diagnostics:
/Users/danielcollin/clang-3.8/include/c++/v1/cstddef:43:15: fatal error: 'stddef.h' file not found
thread 'main' panicked at 'terminated because of clang errors', src/cpp_parser.rs:172
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Generator commands should be like that:
cargo run -- -s $REPOS/qt_core -o $OUT/qt_core
cargo run -- -s $REPOS/qt_gui -o $OUT/qt_gui -d $OUT/qt_core
cargo run -- -s $REPOS/qt_widgets -o $OUT/qt_widgets -d $OUT/qt_core $OUT/qt_gui
Does /Users/danielcollin/clang-3.8/lib/clang/3.8.0/include
dir exist? Does it contain stddef.h
?
Yeah, it's there. Maybe the issues is that -isystem
is used instead of -I
?
IIRC, it didn't work for me until I replaced -I
with -isystem
. You can tweak it at src/cpp_parser.rs:143
and see what happens. Also try to check if libclang
from the same directory is used and not some system-wide installation.
I don't fully understand why these headers are not visible by default. They are visible to clang
binary, but not libclang
for some reason. I found that this issue is mentioned a lot, but I didn't find any canonical solution.
Setting -I
make it work. I now run into
/Users/danielcollin/Qt5.7.0/lib/QtCore.framework/Headers/qsystemdetection.h:95:12: fatal error: 'TargetConditionals.h' file not found
TargetConditionals.h seems to be some Mac specific header in the sdk that can be found
MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/usr/include/TargetConditionals.h
I'm unsure how the script can pick up that path though unless travis sets that up somehow.
On my system Qt Creator shows that it uses TargetConditionals.h
from /usr/include
directory. Try to add -I /usr/include
.
Hum.. I don't even have have /usr/include
dir on my system.
I've found this: http://superuser.com/a/1014872/40045 It seems that you have XCode without command line developer tools, while I have command line developer tools without XCode. Maybe you can install these tools and it will start working. I'm totally unfamiliar with OS X ecosystem, so I'm not sure if it has any drawbacks.
Will try!
Ok.. now it's running and doing stuff!
Seems to work fine now.
Great! Check if it works with original version (with "-isystem") with command line tools installed. If not, please submit a PR so that we can see what Travis thinks about it.
Seems to work fine without it so all good.
When generating code for qt_gui
This is when generating code for Qt 5.7 on Mac (using the travis branch)