Skip to content

Commit

Permalink
workaround error=address warning with C++ modules on MS Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Jan 26, 2023
1 parent 6093b14 commit c90ddb7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,9 @@ def ace(modnames="xpra.x11.bindings.xxx", pkgconfig_names="", optimize=None, **k
value = (value, )
add_to_keywords(pkgc, addto, *value)
pkgc.update(kwargs)
if WIN32 and kwargs.get("language", "")=="c++":
#all C++ modules trigger an address warning in the module initialization code:
add_to_keywords.append(pkgc, "extra_compile_args", "-Wno-error=address")
add_cython_ext(modname, src, **pkgc)

def tace(toggle, *args, **kwargs):
Expand Down Expand Up @@ -1977,12 +1980,8 @@ def add_cython_ext(*_args, **_kwargs):
toggle_packages(client_ENABLED and opengl_ENABLED and gtk3_ENABLED, "xpra.client.gl.gtk3")
toggle_packages(client_ENABLED and gtk3_ENABLED and example_ENABLED, "xpra.client.gtk_base.example")
if client_ENABLED and WIN32 and MINGW_PREFIX:
extra_compile_args = []
if WIN32:
extra_compile_args.append("-Wno-error=address")
ace("xpra.platform.win32.propsys,xpra/platform/win32/setappid.cpp",
language="c++",
extra_compile_args=extra_compile_args,
extra_link_args = ("-luuid", "-lshlwapi", "-lole32", "-static-libgcc")
)

Expand Down Expand Up @@ -2252,8 +2251,7 @@ def nvcc_compile(nvcc_cmd):
toggle_packages(dec_avcodec2_ENABLED, "xpra.codecs.dec_avcodec2")
tace(dec_avcodec2_ENABLED, "xpra.codecs.dec_avcodec2.decoder,xpra/codecs/dec_avcodec2/register_compat.c", "libavcodec,libavutil,libavformat")
toggle_packages(csc_libyuv_ENABLED, "xpra.codecs.csc_libyuv")
tace(csc_libyuv_ENABLED, "xpra.codecs.csc_libyuv.colorspace_converter", "libyuv", language="c++",
extra_compile_args = ("-Wno-error=address", ) if WIN32 else ())
tace(csc_libyuv_ENABLED, "xpra.codecs.csc_libyuv.colorspace_converter", "libyuv", language="c++")
toggle_packages(csc_swscale_ENABLED, "xpra.codecs.csc_swscale")
tace(csc_swscale_ENABLED, "xpra.codecs.csc_swscale.colorspace_converter", "libswscale,libavutil")
toggle_packages(csc_cython_ENABLED, "xpra.codecs.csc_cython")
Expand Down

0 comments on commit c90ddb7

Please sign in to comment.