Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions recipe/activate.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
@@echo off
setlocal enabledelayedexpansion

:: save existing variables for deactivation script; initialize all backups to a placeholder
:: (empty is the same as undefined), and only overwrite them if a value exists
for %%X in (
CC CXX CMAKE_ARGS CMAKE_GEN CMAKE_GENERATOR CMAKE_GENERATOR_PLATFORM CMAKE_GENERATOR_TOOLSET
CMAKE_PLAT CMAKE_PREFIX_PATH CONDA_BUILD_CROSS_COMPILATION DISTUTILS_USE_SDK INCLUDE LATEST_VS
LIB MSSdk MSYS2_ARG_CONV_EXCL MSYS2_ENV_CONV_EXCL NEWER_VS_WITH_OLDER_VC PY_VCRUNTIME_REDIST
USE_NEW_CMAKE_GEN_SYNTAX VCVARSBAT VSINSTALLDIR VS_MAJOR VS_VERSION VS_YEAR WindowsSDKVer
Comment thread
h-vetinari marked this conversation as resolved.
Outdated
) do (
set "_CONDA_BACKUP_%%X=placeholder"
Comment thread
h-vetinari marked this conversation as resolved.
Outdated
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
Expand Down
17 changes: 17 additions & 0 deletions recipe/deactivate.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@@echo off
setlocal enabledelayedexpansion

:: restore variables (if they existed prior to activation, they have a value that's not "placeholder")
for %%X in (
CC CXX CMAKE_ARGS CMAKE_GEN CMAKE_GENERATOR CMAKE_GENERATOR_PLATFORM CMAKE_GENERATOR_TOOLSET
CMAKE_PLAT CMAKE_PREFIX_PATH CONDA_BUILD_CROSS_COMPILATION DISTUTILS_USE_SDK INCLUDE LATEST_VS
LIB MSSdk MSYS2_ARG_CONV_EXCL MSYS2_ENV_CONV_EXCL NEWER_VS_WITH_OLDER_VC PY_VCRUNTIME_REDIST
USE_NEW_CMAKE_GEN_SYNTAX VCVARSBAT VSINSTALLDIR VS_MAJOR VS_VERSION VS_YEAR WindowsSDKVer
) do (
if "!_CONDA_BACKUP_%%X!" == "placeholder" (
set "%%X="
) else (
Comment thread
h-vetinari marked this conversation as resolved.
Outdated
set "%%X=!_CONDA_BACKUP_%%X!"
)
set "_CONDA_BACKUP_%%X="
)
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
6 changes: 6 additions & 0 deletions recipe/vc_repack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down