New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cmake driver #847
Add cmake driver #847
Conversation
I found that sometimes Driver won't copy some c source files. For example:
and source file:
compiling this with rock -vv will show that:
It shows that the c sources of stb-vorbis is not copied.
Make driver also fails on this. |
Some changes to front/CommandLine CMake needs a project name but current dummy module does not have a name (it is set to "" explicitly) |
Fix the problem that rock does not copy c sources in uses' requirement When we directly compile *.use file(which usually means compile to library), requirement is not properly added to dummy module. This commit fixes it. |
I found that MakeDriver do not have the ability of compiling to library. When we compiling a use file without main, it still tries to generate executable. And also there's no option for generate static/shared library. ( May be I missed something? ) |
Commit horasal@ff24719 does not really work... |
Revert horasal@ff24719 and fix the problem. |
Everything seems good. |
CMakeDriver updated Sometimes some flags may not work. This may be related to: #758 For example, now make file will check -m flag:
|
Flag check is fragile. When using -m32 on x86-64 machines, cmake fails to check all flags after -m32. And also, I'm trying building rock with tcc, but it always fails without any error message... |
Todo: |
clang/tcc do not use this flag
@zhaihj I merged your work so far. Seems to work to build rock indeed! Haven't tried other, more convoluted projects. The reason I was prudent approaching a CMake driver is that I didn't want it to be "dumb" — ie. directly copying include paths & lib paths to the CMakeLists.txt would've been bad. I see you're using FindPkgConfig, which takes care of that, so, good! I'm sure we'll run into other problems in the future, but for now I think this version is a good start. |
Add a simple cmake driver.
can be used by
This works for rock's source.