diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2018-05-03 17:52:11 -0400 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2018-05-03 17:55:03 -0400 |
commit | 39df5831cae0dce4628e80cf7f6f5520a9dae18e (patch) | |
tree | b36300395928c7624a5c5f7258fdad85b8935a82 /pkgs/development/compilers/llvm/4 | |
parent | b45ef79b74d267891a11c1775a473c610ecebe78 (diff) | |
download | nixlib-39df5831cae0dce4628e80cf7f6f5520a9dae18e.tar nixlib-39df5831cae0dce4628e80cf7f6f5520a9dae18e.tar.gz nixlib-39df5831cae0dce4628e80cf7f6f5520a9dae18e.tar.bz2 nixlib-39df5831cae0dce4628e80cf7f6f5520a9dae18e.tar.lz nixlib-39df5831cae0dce4628e80cf7f6f5520a9dae18e.tar.xz nixlib-39df5831cae0dce4628e80cf7f6f5520a9dae18e.tar.zst nixlib-39df5831cae0dce4628e80cf7f6f5520a9dae18e.zip |
lib{std,}c++: Fix setup hooks for cross
Diffstat (limited to 'pkgs/development/compilers/llvm/4')
-rw-r--r-- | pkgs/development/compilers/llvm/4/libc++/setup-hook.sh | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/pkgs/development/compilers/llvm/4/libc++/setup-hook.sh b/pkgs/development/compilers/llvm/4/libc++/setup-hook.sh index 9022fced6ecf..bcd93cf486ff 100644 --- a/pkgs/development/compilers/llvm/4/libc++/setup-hook.sh +++ b/pkgs/development/compilers/llvm/4/libc++/setup-hook.sh @@ -1,3 +1,14 @@ +# The `hostOffset` describes how the host platform of the dependencies +# relative to the depending package. It is brought into scope of the setup hook +# defined as the role of the dependency whose hooks is being run. +case $hostOffset in + -1) local role='BUILD_' ;; + 0) local role='' ;; + 1) local role='TARGET_' ;; + *) echo "cc-wrapper: Error: Cannot be used with $hostOffset-offset deps" >2; + return 1 ;; +esac + linkCxxAbi="@linkCxxAbi@" -export NIX_CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" -export NIX_CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" +export NIX_${role}CXXSTDLIB_COMPILE+=" -isystem @out@/include/c++/v1" +export NIX_${role}CXXSTDLIB_LINK=" -stdlib=libc++${linkCxxAbi:+" -lc++abi"}" |