[Mesa-dev] [PATCH] gallium/auxiliary: don't build NIR sources with MSVC2008 flags

Jose Fonseca jfonseca at vmware.com
Mon Dec 21 08:05:01 PST 2015


On 21/12/15 03:12, Connor Abbott wrote:
> NIR has never been built with MSVC2008, so we shouldn't add
> MSVC_2008_COMPAT_CFLAGS to anything that uses it. This allows us to get
> rid of the pragma in tgsi_to_nir.c.

Yes, this is much cleaner.

> Build tested with freedreno.
>
> Signed-off-by: Connor Abbott <cwabbott0 at gmail.com>
> ---
>   src/gallium/auxiliary/Makefile.am       | 17 ++++++++++++++---
>   src/gallium/auxiliary/nir/tgsi_to_nir.c |  4 ----
>   2 files changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am
> index 7b026b5..d06d171 100644
> --- a/src/gallium/auxiliary/Makefile.am
> +++ b/src/gallium/auxiliary/Makefile.am
> @@ -1,11 +1,10 @@
>   include Makefile.sources
>   include $(top_srcdir)/src/gallium/Automake.inc
>
> -noinst_LTLIBRARIES = libgallium.la
> +noinst_LTLIBRARIES = libgallium_nir.la
>
>   AM_CFLAGS = \
>   	-I$(top_srcdir)/src/loader \
> -	-I$(top_builddir)/src/glsl/nir \
>   	-I$(top_srcdir)/src/gallium/auxiliary/util \
>   	$(GALLIUM_CFLAGS) \
>   	$(VISIBILITY_CFLAGS) \
> @@ -15,11 +14,23 @@ AM_CXXFLAGS = \
>   	$(VISIBILITY_CXXFLAGS) \
>   	$(MSVC2008_COMPAT_CXXFLAGS)
>
> +libgallium_nir_la_SOURCES = \
> +	$(NIR_SOURCES)
> +
> +libgallium_nir_la_CFLAGS = \
> +	-I$(top_builddir)/src/glsl/nir \
> +	$(GALLIUM_CFLAGS) \
> +	$(VISIBILITY_CFLAGS)

I think it's better to add

    	$(MSVC2013_COMPAT_CFLAGS)

here -- it's a subset of MSVC2008_COMPAT_CFLAGS --, as MSVC2013 is 
mostly C99 compliant.

> +
> +noinst_LTLIBRARIES += libgallium.la
> +
>   libgallium_la_SOURCES = \
>   	$(C_SOURCES) \
> -	$(NIR_SOURCES) \
>   	$(GENERATED_SOURCES)
>
> +libgallium_la_LIBADD = \
> +	libgallium_nir.la
> +
>   if HAVE_MESA_LLVM
>
>   AM_CFLAGS += \
> diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c
> index 8082157..932590f 100644
> --- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
> +++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
> @@ -22,10 +22,6 @@
>    * IN THE SOFTWARE.
>    */
>
> -#ifdef __GNUC__
> -#pragma GCC diagnostic ignored "-Wdeclaration-after-statement"
> -#endif
> -
>   #include "util/ralloc.h"
>   #include "glsl/nir/nir.h"
>   #include "glsl/nir/nir_control_flow.h"
>

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>



More information about the mesa-dev mailing list