Test if WebAssembly in C++ code
Solved
Qt for WebAssembly
-
Hi,
I have an application on Qt 5.13.2, I use MinGW (windows) for development and then I compile it in WebAssembly.
I would like to call different C++ function depending on the compiler (mingw/webassembly), is there a way to do it in C++ files ?I have seen this but this is for the .pro file :
contains(CONFIG, mingw) { } else { contains(CONFIG, wasm) { } }
-
@Mixlu Such things are done via
#ifdef SOMETHING // Do something #endif
in C++ (https://en.cppreference.com/w/cpp/preprocessor/conditional).
Such defines can be added using https://doc.qt.io/qt-5/qmake-variable-reference.html#defines in qmake:
DEFINES += SOMETHING