From 8dec62a1a41f1c48aa7bdd3848c0f46a62de4f29 Mon Sep 17 00:00:00 2001 From: stijn Date: Fri, 2 Jan 2015 11:49:23 +0100 Subject: [PATCH] msvc: Define main build/include directories in a single location - Use a single file env.props for defining the main directories used when building. env.props resolves the base directory and defines overridable output directories, and is used by all other build files. - Fix the build currently failing, basically because the preprocessing command for generating qstrdefs uses different include directories than the build itself does. (specifically, qstrdefs.h uses #include "py/mpconfig.h" since the fixes for #1022 in 51dfcb4, so we need to use the base directory as include directory, not the py dir itself). So define a single variable containing the include directories instead and use it where needed. --- windows/msvc/common.props | 11 +++++++---- windows/msvc/env.props | 9 +++++++++ windows/msvc/genhdr.targets | 13 +++++++++---- windows/msvc/sources.props | 4 +--- 4 files changed, 26 insertions(+), 11 deletions(-) create mode 100644 windows/msvc/env.props diff --git a/windows/msvc/common.props b/windows/msvc/common.props index ce0651d2e6..4bc5df5413 100644 --- a/windows/msvc/common.props +++ b/windows/msvc/common.props @@ -1,14 +1,17 @@  - + + + - $(ProjectDir) - $(ProjectDir)build\$(Configuration)$(Platform)\ + $(PyOutDir) + $(PyBuildDir)$(Configuration)$(Platform)\ + $(PyBaseDir);$(PyBaseDir)windows;$(PyBaseDir)windows\msvc;$(PyBuildDir) - .\;..\;.\build;.\msvc + $(PyIncDirs);%(AdditionalIncludeDirectories) _USE_MATH_DEFINES;_CRT_SECURE_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions) false Level1 diff --git a/windows/msvc/env.props b/windows/msvc/env.props new file mode 100644 index 0000000000..824b529e67 --- /dev/null +++ b/windows/msvc/env.props @@ -0,0 +1,9 @@ + + + + $([System.IO.Path]::GetFullPath(`$(MSBuildThisFileDirectory)..\..`))\ + $(MSBuildThisFileDirectory)build\ + $(PyBaseDir)windows\ + True + + diff --git a/windows/msvc/genhdr.targets b/windows/msvc/genhdr.targets index e359b44419..fe0abbe093 100644 --- a/windows/msvc/genhdr.targets +++ b/windows/msvc/genhdr.targets @@ -1,12 +1,14 @@ + + - $(MsBuildThisFileDirectory)..\..\py\ - $(MsBuildThisFileDirectory)..\build\genhdr\ + $(PyBaseDir)py\ + $(PyBuildDir)genhdr\ @@ -17,10 +19,13 @@ $(DestDir)qstrdefs.preprocessed.h - $(MsBuildThisFileDirectory)..\..\unix\qstrdefsport.h + $(PyBaseDir)unix\qstrdefsport.h $(DestDir)qstrdefs.generated.h - + + + + diff --git a/windows/msvc/sources.props b/windows/msvc/sources.props index 364f36b044..7ec0b652bd 100644 --- a/windows/msvc/sources.props +++ b/windows/msvc/sources.props @@ -1,8 +1,6 @@ - - $(MsbuildThisFileDirectory)..\..\ - +