IF ( CMAKE_CXX_COMPILER MATCHES "/em\\+\\+(-[a-zA-Z0-9.])?$" )
    SET ( EMSCRIPTEN 1 )

    SET ( CMAKE_AR "emcc" )
    SET ( CMAKE_STATIC_LIBRARY_SUFFIX ".bc" )
    SET ( CMAKE_C_CREATE_STATIC_LIBRARY "<CMAKE_AR> -o <TARGET> <LINK_FLAGS> <OBJECTS>" )
    SET ( CMAKE_CXX_CREATE_STATIC_LIBRARY "<CMAKE_AR> -o <TARGET> <LINK_FLAGS> <OBJECTS>" )
	SET ( CMAKE_CXX_FLAGS "-O3 -std=c++14 -s TOTAL_MEMORY=268435456" )
    SET ( CMAKE_EXECUTABLE_SUFFIX ".js" )
ENDIF ()
