Coder Social home page Coder Social logo

unrealmacronuke's Introduction

UnrealMacroNuke

[Unreal Engine tool] Include that 3rd-party library in a decontaminated macro environment

If you have ever tried to include a 3rd party library into an Unreal Engine project, you probably know by now that UE pollutes the macro environment with macros like check(), dynamic_cast() etc., causing compile failures for virtually anything you try to include. Related discussions on the web:

This small script scans all UE headers in the Runtime/ folder and generates a pair of header files for temporarily undefining (almost) all macros that are defined there. Macros starting with an underscore are ignored, because UE touches some Visual Studio macros, too, and just blindly undefining them would break VS.

Download

If you have Cygwin, MSYS2 or something alike installed, then you can download and run the script by yourself. Otherwise, download a generated pair of headers for your version of UE from the releases page.

Usage

Due to some compiler switches that Unreal Engine enables, you probably need to disable also some warnings. If you know that your 3rd-party library compiles cleanly in a clean non-UE project, then just keep disabling any warnings you get with UE, as shown below, and pray. :)

#pragma warning( push )
#pragma warning( disable: <...> )    // For example: 4268 4582 4583 4868

#include "UndefineMacros_UE_4.17.h"
#include "your/third/party/library.hpp"
#include "RedefineMacros_UE_4.17.h"

#pragma warning( pop )

Also, please consider dropping a vote or a comment in the aforementioned Answerhub questions to give Epic some pressure to fix this madness for good.

unrealmacronuke's People

Contributors

hiili avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  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.