From 939fa20cf38e60b27349205e4fdcdadb2f7e350c Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 24 Oct 2023 09:31:49 +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 --- config/hwloc.m4 | 1 + utils/lstopo/Makefile.am | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/hwloc.m4 b/config/hwloc.m4 index 3fddacf49e..3a915cb1d6 100644 --- a/config/hwloc.m4 +++ b/config/hwloc.m4 @@ -1789,6 +1789,7 @@ AC_DEFUN([HWLOC_DO_AM_CONDITIONALS],[ AM_CONDITIONAL([HWLOC_BUILD_STANDALONE], [test "$hwloc_mode" = "standalone"]) AM_CONDITIONAL([HWLOC_HAVE_GCC], [test "x$GCC" = "xyes"]) + AM_CONDITIONAL([HWLOC_HAVE_MSVC], [test "$hwloc_c_vendor" = "microsoft"]) AM_CONDITIONAL([HWLOC_HAVE_MS_LIB], [test "x$HWLOC_MS_LIB" != "x"]) AM_CONDITIONAL([HWLOC_HAVE_OPENAT], [test "x$hwloc_have_openat" = "xyes"]) AM_CONDITIONAL([HWLOC_HAVE_SCHED_SETAFFINITY], diff --git a/utils/lstopo/Makefile.am b/utils/lstopo/Makefile.am index 9e06b0b3c1..adb71647cc 100644 --- a/utils/lstopo/Makefile.am +++ b/utils/lstopo/Makefile.am @@ -1,4 +1,4 @@ -# Copyright © 2009-2020 Inria. All rights reserved. +# Copyright © 2009-2023 Inria. All rights reserved. # Copyright © 2009-2012, 2014 Université Bordeaux # Copyright © 2009-2014 Cisco Systems, Inc. All rights reserved. # Copyright © 2020 Hewlett Packard Enterprise. All rights reserved. @@ -60,7 +60,10 @@ lstopo_LDADD += -luser32 endif lstopo_win_SOURCES = $(lstopo_SOURCES) lstopo_win_CPPFLAGS = $(lstopo_CPPFLAGS) -lstopo_win_CFLAGS = $(lstopo_CFLAGS) -mwindows +lstopo_win_CFLAGS = $(lstopo_CFLAGS) +if !HWLOC_HAVE_MSVC +lstopo_win_CFLAGS += -mwindows +endif lstopo_win_LDADD = $(lstopo_LDADD) endif