writeC: use clang for OSX compatibility
This commit is contained in:
@@ -200,12 +200,12 @@ pkgs: oldpkgs: {
|
|||||||
PATH=${makeBinPath [
|
PATH=${makeBinPath [
|
||||||
pkgs.binutils-unwrapped
|
pkgs.binutils-unwrapped
|
||||||
pkgs.coreutils
|
pkgs.coreutils
|
||||||
pkgs.gcc
|
|
||||||
pkgs.pkgconfig
|
pkgs.pkgconfig
|
||||||
|
pkgs.stdenv.cc
|
||||||
]}
|
]}
|
||||||
exe=$out${destination}
|
exe=$out${destination}
|
||||||
mkdir -p "$(dirname "$exe")"
|
mkdir -p "$(dirname "$exe")"
|
||||||
gcc \
|
cc \
|
||||||
${optionalString (libraries != [])
|
${optionalString (libraries != [])
|
||||||
/* sh */ "$(pkg-config --cflags --libs ${
|
/* sh */ "$(pkg-config --cflags --libs ${
|
||||||
concatMapStringsSep " " escapeShellArg (attrNames libraries)
|
concatMapStringsSep " " escapeShellArg (attrNames libraries)
|
||||||
@@ -216,7 +216,9 @@ pkgs: oldpkgs: {
|
|||||||
-Wall \
|
-Wall \
|
||||||
-x c \
|
-x c \
|
||||||
"$textPath"
|
"$textPath"
|
||||||
|
${optionalString (!pkgs.stdenv.hostPlatform.isDarwin) /* sh */ ''
|
||||||
strip --strip-unneeded "$exe"
|
strip --strip-unneeded "$exe"
|
||||||
|
''}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Like writeScript but the first line is a shebang to dash
|
# Like writeScript but the first line is a shebang to dash
|
||||||
|
|||||||
Reference in New Issue
Block a user