Comments (6)
I think it would be nice to remove dependency on cmake, but I don't want to reinvent cmake. It actually solves a lot of issues:
- It automatically builds a shared or static library from a folder of source files in a cross-platform way;
- It skips building source files that were not changed (extremely important during development);
- it allows to have parallel builds with "make -j N";
- It allows to install all headers and library files in a chosen folder easily.
All this is accomplished with a very simple config file (less than 20 lines). How much code will it take to implement the same behavior using gcc crate? How much of these features can it provide?
from ritual.
In the simplest form using the gcc crate is this
// build.rs
extern crate gcc;
fn main() {
gcc::compile_library("libfoo.a", &["foo.c", "bar.c"]);
}
- The gcc crate uses rayon to build in parallel also and uses the correct compiler given the version of Rust (if MSVC on Windows it will build the code using MSVC etc)
- Also for a user of a crate they will very rarely change the code inside the crate they just want to build the crate by adding a dependency in their project.
- You can pick any folder to have the files for the gcc crate also.
- Unsure about incremental. Yet this isn't important for a crate user as the will build the crate and don't touch it again.
from ritual.
But MSVC libraries are *.lib, not *.a. Also it seems that this crate doesn't support shared libraries, only static ones. I need shared libraries for MSVC because it can't compile them statically (too many symbols).
from ritual.
The gcc crate uses *.a even for msvc. I have used this in several projects and it works just fine. I have never ran into the issue with too many symbols on msvc so unsure about that.
from ritual.
Actually, this feature would be useful even if it doesn't cover all use cases. We can leave cmake as default option and fallback to gcc crate if cmake is not available and there are no other issues.
from ritual.
Sounds good!
from ritual.
Related Issues (20)
- Is there some way to let IDE (Clion) pop up autocomplete menu? HOT 3
- Broken doc link
- MSVC 32bit HOT 1
- MSVC 32-bit surpport HOT 1
- Protected values inaccessible
- QFlags generation fails across crate boundaries
- Help - VSCode auto completion? HOT 1
- Cannot run examples HOT 5
- Ritual doesn't compile. Errors when compiling "amq-proto" HOT 1
- Can't find qmake because it doesn't exist
- Cannot create and render a Widget called from another Widget... HOT 1
- looking for SignalOfQlistOfQPointF and SlotOfQlistOfQPointF...
- Unknown Qt Version 5.15.x
- Request for better errors when command is not available (cmake)
- [Question] how to make it safe?
- How to build qt shared library ?
- Exit code 2 from CMake HOT 1
- linux arm 32 supper
- WASM Support HOT 2
- missing `invokeMethod` function for `QMetaObject` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ritual.