Giter VIP home page Giter VIP logo

Comments (11)

LPGhatguy avatar LPGhatguy commented on August 26, 2024 1

The method that might prove most effective is bundling the sources like the libsqlte3-sys crate does when given the bundled option. This makes distribution and building on platforms like Windows much, much easier. That crate uses the gcc crate to compile the source, which also gives stronger version guarantees than depending on a system-installed library.

Checkout https://github.com/jgallagher/rusqlite#notes-on-building-rusqlite-and-libsqlite3-sys

from bulletrs.

not-fl3 avatar not-fl3 commented on August 26, 2024 1

Well, I built the hugest build.rs ever :)
https://github.com/not-fl3/bulletrs/blob/buildrs/bulletrs-sys/build.rs

It was built with semi-automated parse of cmake output. Seriously considering to describe that process and propose to cargo-native as a way to create cc-rs scripts for cmake-based huge projects.

There is only one platform-dependant string now - .define("_LINUX", None) for only one of bullets libs. I think defining "WIN32" or "DARWIN" should be enough for other platforms. Going to do it after few days of linux-only testing.

I have no experience with build.rs files of that scale, so any comments and test reports are highly welcome.

from bulletrs.

not-fl3 avatar not-fl3 commented on August 26, 2024 1

Tested on MacOS. "Direct" only build, like on windows, works fine.

from bulletrs.

not-fl3 avatar not-fl3 commented on August 26, 2024

Thanks, looks really similar, will take a closer look.

from bulletrs.

nanokatze avatar nanokatze commented on August 26, 2024

Fyi gcc got renamed to cc few days ago when it hit version 1.0.0

from bulletrs.

not-fl3 avatar not-fl3 commented on August 26, 2024

I think that bullet3d is a bit too complicated to dealing with it throw cc crate.

I am considering participating in cargo-native as an option (https://paper.dropbox.com/doc/Declarative-native-dependencies-iLRUq6Zt2tPtLWE9IyLqS). Like check what people will do and try to fit bulletrs to this somehow.

from bulletrs.

LPGhatguy avatar LPGhatguy commented on August 26, 2024

That build file is probably cleaner than most large CMake files I've seen :/

from bulletrs.

not-fl3 avatar not-fl3 commented on August 26, 2024

Removed all UI and Networking from bullet for windows build not-fl3/bullet3@not-fl3:789258448fb95ebdb08a41c0db0efa63a711b877...rustbindings
And now it's working both on linux (with Graphics Debugger, UI, Networking and everything) and on windows (with Direct connection only). Open for PR's for MacOs :)
It works for me and I am going to use it that way.

I had 2 alternatives of that build.rs approach.

  • cmake-rs
  • link with binary object file in build.rs

cmake-rs force users to have cmake on their machines. And it is probably well. But the problem here is bullet's CMake file. For both windows and linux it should be deeply modified :( For windows specifically - bullet is supposed to be built with Visual Studio. And pros of cmake-rs - easy to maintan and update bullet.

binary object file - may be the best thing for users - if I'll provide it for all of the platforms. And may be convinient for me - it is possible to set up travis to build it somehow. But also requires a lot of work on Windows to build that file.

And build.rs approach. I thought that its possible to autogenerate build.rs file from make's output, but actually it is not - too much platform-specific things. So it will be hard to update to new bullet's versions. And with "ccache" development iteration cycle is pretty fast - comparable to cmake's.

from bulletrs.

not-fl3 avatar not-fl3 commented on August 26, 2024

Next step to crates.io - CI #3

from bulletrs.

CoolOppo avatar CoolOppo commented on August 26, 2024

Seriously considering to describe that process and propose to cargo-native as a way to create cc-rs scripts for cmake-based huge projects.

Please do! Would be very helpful.

from bulletrs.

not-fl3 avatar not-fl3 commented on August 26, 2024

Some time passed since I made this and in the hindsight I think that making build.rs from the cmake output was not so good idea.
While it works for bullet for some specific platforms its definitely not a general purpose solution :(

from bulletrs.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.