bscpkgs/pkgs/intel-compiler/wrapper2021.nix

30 lines
987 B
Nix
Raw Permalink Normal View History

2021-06-16 14:26:48 +02:00
{
stdenv
, gcc
, iccUnwrapped
, wrapCCWith
}:
let
targetConfig = stdenv.targetPlatform.config;
inherit gcc;
in wrapCCWith rec {
cc = iccUnwrapped;
extraBuildCommands = ''
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags
echo "-isystem ${iccUnwrapped}/include" >> $out/nix-support/cc-cflags
echo "-isystem ${iccUnwrapped}/include/icc" >> $out/nix-support/cc-cflags
2021-07-05 17:06:23 +02:00
echo "-isystem ${gcc.cc}/include/c++/${gcc.version}" >> $out/nix-support/cc-cflags
echo "-isystem ${gcc.cc}/include/c++/${gcc.version}/${targetConfig}" >> $out/nix-support/cc-cflags
2021-06-16 19:30:43 +02:00
echo "-L${iccUnwrapped}/lib" >> $out/nix-support/cc-ldflags
2021-06-16 14:26:48 +02:00
echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags
echo "-L${gcc.cc.lib}/lib" >> $out/nix-support/cc-ldflags
2021-06-16 19:30:43 +02:00
# Create the wrappers for icx*
wrap lld $wrapper $ccPath/lld
2021-06-16 14:26:48 +02:00
wrap icx $wrapper $ccPath/icx
2021-06-16 19:30:43 +02:00
wrap icpx $wrapper $ccPath/icpx
2021-06-16 14:26:48 +02:00
'';
}