Skip to content

Commit

Permalink
Add adapted powershell activations (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
WardBrian authored Aug 24, 2024
1 parent 1bb6a07 commit fc7ab01
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
11 changes: 11 additions & 0 deletions recipe/activate-clang_win-64.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$Env:CC="clang.exe"
$Env:NM="llvm-nm.exe"
$Env:LD="lld-link.exe"
$Env:AR="llvm-ar.exe"
$Env:RANLIB="llvm-ranlib.exe"
$Env:NM="llvm-nm.exe"
$Env:LD="lld-link.exe"

$Env:CPPFLAGS_USED="-D_CRT_SECURE_NO_WARNINGS -nostdlib -fms-runtime-lib=dll -fuse-ld=lld -fno-aligned-allocation"
$Env:LDFLAGS="-nostdlib -Wl,-defaultlib:" + $Env:CONDA_PREFIX.Replace("\","/") +"/lib/clang/@MAJOR_VER@/lib/windows/clang_rt.builtins-x86_64.lib"
$Env:CFLAGS="@CFLAGS@ " + $Env:CPPFLAGS_USED
2 changes: 2 additions & 0 deletions recipe/activate-clangxx_win-64.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$Env:CXX="clang++.exe"
$Env:CXXFLAGS="@CXXFLAGS@ " + $Env:CPPFLAGS_USED
12 changes: 12 additions & 0 deletions recipe/install-pkg.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,25 @@ if [%PKG_NAME%] == [clang_win-64] (
if %ERRORLEVEL% neq 0 exit 1
sed -i 's/@MAJOR_VER@/%MAJOR_VER%/g' vs%VSYEAR%_y-clang_win-64.bat
if %ERRORLEVEL% neq 0 exit 1

copy "%RECIPE_DIR%\activate-clang_win-64.ps1" ".\vs%VSYEAR%_y-clang_win-64.ps1"
if %ERRORLEVEL% neq 0 exit 1
sed -i 's/@CFLAGS@/%FINAL_CFLAGS%/g' vs%VSYEAR%_y-clang_win-64.ps1
if %ERRORLEVEL% neq 0 exit 1
sed -i 's/@MAJOR_VER@/%MAJOR_VER%/g' vs%VSYEAR%_y-clang_win-64.ps1
if %ERRORLEVEL% neq 0 exit 1
) else if [%PKG_NAME%] == [clangxx_win-64] (
REM Similarly, we need clangxx activation after clang (so add "z" after "y"),
REM to ensure that we have CPPFLAGS_USED available
copy "%RECIPE_DIR%\activate-clangxx_win-64.bat" ".\vs%VSYEAR%_z-clangxx_win-64.bat"
if %ERRORLEVEL% neq 0 exit 1
sed -i 's/@CXXFLAGS@/%FINAL_CXXFLAGS%/g' vs%VSYEAR%_z-clangxx_win-64.bat
if %ERRORLEVEL% neq 0 exit 1

copy "%RECIPE_DIR%\activate-clangxx_win-64.ps1" ".\vs%VSYEAR%_z-clangxx_win-64.ps1"
if %ERRORLEVEL% neq 0 exit 1
sed -i 's/@CXXFLAGS@/%FINAL_CXXFLAGS%/g' vs%VSYEAR%_z-clangxx_win-64.ps1
if %ERRORLEVEL% neq 0 exit 1
) else (
REM shouldn't happen
exit 1
Expand Down
2 changes: 1 addition & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% set cl_minor = CL_VERSION.split(".")[1] %}
{% set vc_major = VCVER.split(".")[0] %}

{% set build_number = 13 %}
{% set build_number = 14 %}

# separate builds number for headers & winsdk; reset when version increases (resp. all relevant versions)
{% set headers_build_number = 4 %}
Expand Down

0 comments on commit fc7ab01

Please sign in to comment.