From 967ceba5b7fc56f7642947b2c48199a4d9db0d4a Mon Sep 17 00:00:00 2001 From: stijn Date: Thu, 12 Nov 2015 09:42:12 +0100 Subject: [PATCH] msvc: Use different output directories depending on build type This allows multiple versions (e.g. Debug/Release, x86/x64) of micropython.exe to co-exist instead and also solves potential problems where msbuild does not completely rebuild the output and/or pdb files when switching between builds, which in turn can cause linker errors in dependent projects. By default exe/map/... files go in windows/build/$(Configuration)$(Platform) After each build micropython.exe is still copied from the above directory to the windows directory though, as that is consistent with the other ports and the test runner by default uses that location as well. Also rename env.props -> path.props which is a clearer name, and add ample documentation in the affected build files. (also see discussion in #1538) --- windows/msvc/common.props | 27 ++++++++++++++++++---- windows/msvc/env.props | 9 -------- windows/msvc/genhdr.targets | 2 +- windows/msvc/paths.props | 45 +++++++++++++++++++++++++++++++++++++ windows/msvc/sources.props | 2 +- 5 files changed, 70 insertions(+), 15 deletions(-) delete mode 100644 windows/msvc/env.props create mode 100644 windows/msvc/paths.props diff --git a/windows/msvc/common.props b/windows/msvc/common.props index 73103f627a..cfb6adbc14 100644 --- a/windows/msvc/common.props +++ b/windows/msvc/common.props @@ -1,13 +1,13 @@  - + $(PyOutDir) - $(PyBuildDir)$(Configuration)$(Platform)\ - $(PyBaseDir);$(PyBaseDir)windows;$(PyBaseDir)windows\msvc;$(PyBuildDir) + $(PyIntDir) + $(PyBuildDir)copycookie$(Configuration)$(Platform) @@ -22,5 +22,24 @@ true - + + + $(PyWinDir)%(FileName)%(Extension) + + + + + + + + + + + diff --git a/windows/msvc/env.props b/windows/msvc/env.props deleted file mode 100644 index 824b529e67..0000000000 --- a/windows/msvc/env.props +++ /dev/null @@ -1,9 +0,0 @@ - - - - $([System.IO.Path]::GetFullPath(`$(MSBuildThisFileDirectory)..\..`))\ - $(MSBuildThisFileDirectory)build\ - $(PyBaseDir)windows\ - True - - diff --git a/windows/msvc/genhdr.targets b/windows/msvc/genhdr.targets index 93bb74ee9d..3d9a148bed 100644 --- a/windows/msvc/genhdr.targets +++ b/windows/msvc/genhdr.targets @@ -1,7 +1,7 @@ - + diff --git a/windows/msvc/paths.props b/windows/msvc/paths.props new file mode 100644 index 0000000000..7166982434 --- /dev/null +++ b/windows/msvc/paths.props @@ -0,0 +1,45 @@ + + + + True + + + + + $([System.IO.Path]::GetFullPath(`$(MSBuildThisFileDirectory)..\..`))\ + $(PyBaseDir)windows\ + $(PyWinDir)build\ + + + $(PyBaseDir);$(PyWinDir);$(PyBuildDir);$(PyWinDir)msvc + + + $(Platform) + $(Configuration) + + + $(PyBuildDir)$(PyConfiguration)$(PyPlatform)\ + $(PyOutDir)obj\ + + diff --git a/windows/msvc/sources.props b/windows/msvc/sources.props index eea28fc46e..b840025006 100644 --- a/windows/msvc/sources.props +++ b/windows/msvc/sources.props @@ -1,6 +1,6 @@ - +