From df6e4b6cf1fc25bf768fbc03cb7a8deed266eb25 Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Mon, 20 Mar 2017 11:32:32 -0500 Subject: pkg: Check INCLUDE environment variable for MSVC On Windows builds when --msvc-syntax is in use, add paths in the INCLUDE environment variable to the system include search path and ignore the various GCC environment variables. See https://msdn.microsoft.com/en-us/library/73f9s62w.aspx for details. https://bugs.freedesktop.org/show_bug.cgi?id=94729 --- check/check-system-flags | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'check') diff --git a/check/check-system-flags b/check/check-system-flags index 831dd0e..632496c 100755 --- a/check/check-system-flags +++ b/check/check-system-flags @@ -39,9 +39,28 @@ run_test --cflags system RESULT="-L/usr/lib -lsystem" run_test --libs system -# Now check that the various compiler environment variables also update -# the system include path +# Now check that the various GCC environment variables also update the +# system include path for var in CPATH C_INCLUDE_PATH CPP_INCLUDE_PATH; do RESULT="" eval $var=/usr/include run_test --cflags system + + # Make sure these are not skipped in --msvc-syntax mode + if [ "$native_win32" = yes ]; then + RESULT="-I/usr/include" + eval $var=/usr/include run_test --cflags --msvc-syntax system + fi +done + +# Check that the various MSVC environment variables also update the +# system include path when --msvc-syntax is in use +for var in INCLUDE; do + RESULT="-I/usr/include" + eval $var=/usr/include run_test --cflags system + + # Make sure these are skipped in --msvc-syntax mode + if [ "$native_win32" = yes ]; then + RESULT="" + eval $var=/usr/include run_test --cflags --msvc-syntax system + fi done -- cgit v1.2.1