Git Product home page Git Product logo

bazel-mingw64's Introduction

MinGW64 Toolchain for Bazel

For learning - not for production

About

In this project, we register a custom toolchain to be able to cross-compile the project to Windows using the MinGW64 project (which is a GCC) running on Linux x86/x64 but targetting Windows x86/x64.

The example project to build with that toolchain is one shared library used by one executable. This is tailored to Ubuntu 22.04 with MinGW64 version 10.

Limitation

Bazel needs to be built from my fork where a bug is fixed which otherwise causes linking to fail in upstream Bazel.

Building

You need to install MinGW64 (once):

sudo apt install gcc-mingw-w64 g++-mingw-w64

Then you can build for x86_64,

bazel build --config=wine64 //example/greeter

or for i686

bazel build --config=wine32 //example/greeter

The configs imply --platforms=//toolchain:mingw-x86_64-win32 and --platforms=//toolchain:mingw-x86_32-win32, respectively. As those are only for testing, there are no -posix equivalents.

Running

You need to install Wine (once):

sudo apt install --no-install-recommends wine32 # for i686
sudo apt install --no-install-recommends wine64 # for x86_64

Then you can run for x86_64,

bazel run --config=wine64 //example/greeter Felix

or for i686

bazel run --config=wine32 //example/greeter Felix

bazel-mingw64's People

Contributors

felix-el avatar

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.