From fbac33767903b8d273e12a96a562d3ddaae3beb4 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 31 Jul 2023 15:49:50 +1100 Subject: [PATCH 1/2] fix install-path on windows --- recipe/bld.bat | 4 ++++ recipe/meta.yaml | 14 ++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/recipe/bld.bat b/recipe/bld.bat index 513ac1c..c1b467d 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -3,6 +3,10 @@ mkdir build cd build +:: cut off any extensions after "XY.0.0"; +:: mainly aimed at ".rcX", which is not part of the installation path +set PKG_VERSION=%PKG_VERSION:~0,-4% + set BUILD_CONFIG=Release set "CC=clang-cl.exe" set "CXX=clang-cl.exe" diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d7ccf65..0e49e2f 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -14,7 +14,7 @@ source: - patches/0002-compiler-rt-Make-7.0.0-compatible-with-10.9-SDK.patch build: - number: 0 + number: 1 requirements: build: @@ -51,7 +51,8 @@ outputs: test: commands: - echo {{ MACOSX_DEPLOYMENT_TARGET|default("10.9") }} - - test -f $PREFIX/lib/clang/{{ prod_ver }}/lib/darwin/libclang_rt.osx.a # [osx] + - test -f $PREFIX/lib/clang/{{ prod_ver }}/lib/darwin/libclang_rt.osx.a # [osx] + - if not exist %PREFIX%\lib\clang\{{ prod_ver }}\lib\windows\clang_rt.builtins-x86_64.lib exit 1 # [win] - name: compiler-rt requirements: @@ -65,9 +66,9 @@ outputs: files: - lib/clang/{{ prod_ver }}/share # [unix] - lib/clang/{{ prod_ver }}/include # [unix] - - Library/lib/clang/{{ version }}/share # [win] - - Library/lib/clang/{{ version }}/include # [win] - - Library/lib/clang/{{ version }}/lib # [win] + - Library\lib\clang\{{ prod_ver }}\share # [win] + - Library\lib\clang\{{ prod_ver }}\include # [win] + - Library\lib\clang\{{ prod_ver }}\lib # [win] test: # files: # - test.c.in @@ -75,7 +76,8 @@ outputs: # {% set NEW_TARGET="10." ~ (((MACOSX_DEPLOYMENT_TARGET|default("10.13")).split(".")[1])|int + 1) %} # - sed "s/@MACOSX_DEPLOYMENT_TARGET@/{{ NEW_TARGET }}/g" test.c.in > test.c # - clang -mmacosx-version-min={{ MACOSX_DEPLOYMENT_TARGET }} test.c # [osx] - - test -f $PREFIX/lib/clang/{{ prod_ver }}/include/sanitizer/asan_interface.h # [unix] + - test -f $PREFIX/lib/clang/{{ prod_ver }}/include/sanitizer/asan_interface.h # [unix] + - if not exist %LIBRARY_LIB%\clang\{{ prod_ver }}\lib\windows\clang_rt.builtins-x86_64.lib exit 1 # [win] about: home: http://llvm.org/ From e94a48de1fb232089d8bebc278fa1ae4e7b67f0f Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Mon, 31 Jul 2023 20:56:15 +1100 Subject: [PATCH 2/2] clarify the windows setup a bit file-selection for compiler-rt_win-64 was not broken (conda understands forward slashes), but intent is hopefully clearer now (no "Library\" on win). --- recipe/bld.bat | 4 ++++ recipe/meta.yaml | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/recipe/bld.bat b/recipe/bld.bat index c1b467d..44feee1 100644 --- a/recipe/bld.bat +++ b/recipe/bld.bat @@ -31,5 +31,9 @@ if %ERRORLEVEL% neq 0 exit 1 cmake --install . if %ERRORLEVEL% neq 0 exit 1 +:: Also install into %PREFIX%\lib (!= %PREFIX%\Library\lib, the default on win) +:: because compiler-rt_win-64 is noarch and needs to be installable on linux, +:: where we don't want the "\Library"; aside from removing that directory, +:: the paths are the same. Separation into proper outputs happens in the recipe. mkdir %PREFIX%\lib\clang\%PKG_VERSION%\lib\windows copy %INSTALL_PREFIX%\lib\windows\* %PREFIX%\lib\clang\%PKG_VERSION%\lib\windows\ diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 0e49e2f..f50b48a 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -47,7 +47,9 @@ outputs: run_constrained: - compiler-rt {{ version }} files: - - lib/clang/{{ prod_ver }}/lib + - lib/clang/{{ prod_ver }}/lib # [unix] + # avoid "Library\" for noarch output + - lib\clang\{{ prod_ver }}\lib # [win] test: commands: - echo {{ MACOSX_DEPLOYMENT_TARGET|default("10.9") }} @@ -66,6 +68,7 @@ outputs: files: - lib/clang/{{ prod_ver }}/share # [unix] - lib/clang/{{ prod_ver }}/include # [unix] + # standard windows layout for arch-specific output - Library\lib\clang\{{ prod_ver }}\share # [win] - Library\lib\clang\{{ prod_ver }}\include # [win] - Library\lib\clang\{{ prod_ver }}\lib # [win]