diff --git a/recipe/activate.bat b/recipe/activate.bat index 9af95ff..94f3a21 100755 --- a/recipe/activate.bat +++ b/recipe/activate.bat @@ -1,3 +1,18 @@ +@@echo off +setlocal enabledelayedexpansion + +:: save existing variables for deactivation script +for %%X in ( + CC CXX CMAKE_ARGS CMAKE_GENERATOR CMAKE_GENERATOR_PLATFORM CMAKE_GENERATOR_TOOLSET + CMAKE_PREFIX_PATH CONDA_BUILD_CROSS_COMPILATION DISTUTILS_USE_SDK INCLUDE + LIB MSSdk MSYS2_ARG_CONV_EXCL MSYS2_ENV_CONV_EXCL PY_VCRUNTIME_REDIST + VS_MAJOR VS_VERSION VS_YEAR +) do ( + if defined %%X ( + set "_CONDA_BACKUP_%%X=!%%X!" + ) +) + @@echo on :: Set env vars that tell distutils to use the compiler that we put on path @@ -156,6 +171,16 @@ if %ERRORLEVEL% neq 0 ( ) popd +:: unset auxiliary variables +set "CMAKE_GEN=" +set "CMAKE_PLAT=" +set "LATEST_VS=" +set "NEWER_VS_WITH_OLDER_VC=" +set "USE_NEW_CMAKE_GEN_SYNTAX=" +set "VCVARSBAT=" +set "VSINSTALLDIR=" +set "WindowsSDKVer=" + :GetWin10SdkDir call :GetWin10SdkDirHelper HKLM\SOFTWARE\Wow6432Node > nul 2>&1 if errorlevel 1 call :GetWin10SdkDirHelper HKCU\SOFTWARE\Wow6432Node > nul 2>&1 diff --git a/recipe/deactivate.bat b/recipe/deactivate.bat new file mode 100644 index 0000000..572f7c8 --- /dev/null +++ b/recipe/deactivate.bat @@ -0,0 +1,17 @@ +@@echo off +setlocal enabledelayedexpansion + +:: restore variables +for %%X in ( + CC CXX CMAKE_ARGS CMAKE_GENERATOR CMAKE_GENERATOR_PLATFORM CMAKE_GENERATOR_TOOLSET + CMAKE_PREFIX_PATH CONDA_BUILD_CROSS_COMPILATION DISTUTILS_USE_SDK INCLUDE + LIB MSSdk MSYS2_ARG_CONV_EXCL MSYS2_ENV_CONV_EXCL PY_VCRUNTIME_REDIST + VS_MAJOR VS_VERSION VS_YEAR +) do ( + if defined _CONDA_BACKUP_%%X ( + set "%%X=!_CONDA_BACKUP_%%X!" + set "_CONDA_BACKUP_%%X=" + ) else ( + set "%%X=" + ) +) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index b0cefb3..9e55feb 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -18,7 +18,7 @@ {% set vcvars_ver_maj = cl_version.split(".")[0]|int - 5 %} {% set vcvars_ver_min = cl_version.split(".")[1]|int %} {% set vcvars_ver = vcvars_ver_maj ~ "." ~ vcvars_ver_min %} -{% set build_num = 24 %} +{% set build_num = 25 %} package: name: vs{{ vsyear }} diff --git a/recipe/vc_repack.py b/recipe/vc_repack.py index 5b257a5..8cf396e 100644 --- a/recipe/vc_repack.py +++ b/recipe/vc_repack.py @@ -371,6 +371,12 @@ def main(): ) as w: for line in r: w.write(subs(line, args)) + targetdir = os.path.join(env.prefix, "etc", "conda", "deactivate.d") + os.makedirs(targetdir) + shutil.copyfile( + os.path.join(env.recipe_dir, "deactivate.bat"), + os.path.join(targetdir, f"vs{args.activate_year}_compiler_vars.bat"), + ) if __name__ == "__main__":