Hi Benjamin,

I would be happy if Emscripten had something like what you propose, but
just let me share how we deal with these issues:

If you use cmake then the Emscripten toolchain file defines
EMSCRIPTEN_VERSION (
https://github.com/emscripten-core/emscripten/blob/ceacba11/cmake/Modules/Platform/Emscripten.cmake#L128),
which you can use to direct compilation through cmake=>preprocessor
defines. You unfortunately still have to check the changelog or Emscripten
history manually to find out when each feature was introduced/changed.

For the find event target behavior change in particular, we have the
following in our code:

if (EMSCRIPTEN_VERSION VERSION_GREATER_EQUAL "1.39.5")
    set(EMSCRIPTEN_HAS_NEW_DOM_ELEMENT_LOOKUP_BEHAVIOUR ON)
else()
    set(EMSCRIPTEN_HAS_NEW_DOM_ELEMENT_LOOKUP_BEHAVIOUR OFF)
endif()

Which is later exposed to the C++ preprocessor using configure_file and a
#cmakedefine01.

AndrĂ¡s


On Fri, Apr 10, 2020 at 12:39 PM Benjamin Golinvaux <[email protected]> wrote:

> Hello,
>
> I am writing a library using Emscripten and I stumbled on issues related
> to users using different values for
> DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR when building our lib.
>
> I was about to add a note that mentions the mandatory usage of -s
> DISABLE_DEPRECATED_FIND_EVENT_TARGET_BEHAVIOR=1 but I thought it would be
> more elegant to have the library adapt itself (the client of the library
> have to build it on their own)
>
> I was wondering if I could somehow introspect the settings at compile time
> (with a #define macro) to find out the value of this flag or, if no macro
> is provided, at runtime (worse, but sufficient for my needs)
>
> I think I could use an awful hack where I examine the dom and try to
> register a dummy event callback and check its value, but I would like to
> avoid that if possible.
>
> Thanks in advance for any information on this topic.
>
>
> Benjamin
>
> --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/emscripten-discuss/0f9d5629-8597-4a76-a1e2-d03db349de16%40googlegroups.com
> <https://groups.google.com/d/msgid/emscripten-discuss/0f9d5629-8597-4a76-a1e2-d03db349de16%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/CANPdQvK_XEopA0eqrWNT%3Dvn3jgrVC%3D9UCLZb4w-biX2p%3DNGxOw%40mail.gmail.com.

Reply via email to