From ca5d25a6711f2f6a8ce3a481818d074966e2b9d2 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 24 Oct 2023 14:44:35 +0200 Subject: [PATCH] utils/lstopo: don't build lstopo-win with MSVC Clang can be used in "MSVC mode" to build hwloc using autotools. That mode doesn't support -mwindows just like MSVC doesn't. -mwindows is the only difference between lstopo-win and lstopo, so just disable lstopo-win instead of building both identically. Closes #631 Signed-off-by: Brice Goglin --- utils/lstopo/Makefile.am | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/utils/lstopo/Makefile.am b/utils/lstopo/Makefile.am index adb71647c..452471eb1 100644 --- a/utils/lstopo/Makefile.am +++ b/utils/lstopo/Makefile.am @@ -52,7 +52,11 @@ lstopo_CFLAGS = $(lstopo_no_graphics_CFLAGS) $(HWLOC_CAIRO_CFLAGS) lstopo_LDADD += $(HWLOC_CAIRO_LIBS) $(HWLOC_X11_LIBS) endif if HWLOC_HAVE_WINDOWS -bin_PROGRAMS += lstopo lstopo-win +bin_PROGRAMS += lstopo +if !HWLOC_HAVE_MSVC +# only build lstopo-win if NOT building with MSVC (or Clang in MSVC mode) because it doesn't support -mwindows +bin_PROGRAMS += lstopo-win +endif lstopo_SOURCES += lstopo-windows.c lstopo_CPPFLAGS += -DLSTOPO_HAVE_GRAPHICS if HWLOC_HAVE_USER32 @@ -60,10 +64,7 @@ lstopo_LDADD += -luser32 endif lstopo_win_SOURCES = $(lstopo_SOURCES) lstopo_win_CPPFLAGS = $(lstopo_CPPFLAGS) -lstopo_win_CFLAGS = $(lstopo_CFLAGS) -if !HWLOC_HAVE_MSVC -lstopo_win_CFLAGS += -mwindows -endif +lstopo_win_CFLAGS = $(lstopo_CFLAGS) += -mwindows lstopo_win_LDADD = $(lstopo_LDADD) endif