Reputation: 13567
I have a project that shall be configured/built differently when either using cmake
or emcmake cmake
(followed by make
or emmake make
respectively). For example, I don't need to build a test executable if it is run by emcmake cmake
as the result will be WebAssembly.
So, is there any variable available when run by emcmake cmake
, that I could query? Are there other approaches?
Upvotes: 3
Views: 2010
Reputation: 498
You can detect if emcmake cmake
or emconfigure cmake
are used with the EMSCRIPTEN
variable:
if(EMSCRIPTEN)
message("Using emscripten!")
else()
message("Not using emscripten!")
endif()
Upvotes: 7