igraph: enable autodetection for LTO support (#122058)

> The IGRAPH_ENABLE_LTO build option now supports the AUTO value, which
> uses LTO only if the compiler supports it. Warning: CMake may not
> always be able to detect that LTO is not fully supported. Therefore,
> the default setting is OFF.

https://igraph.org/2021/03/23/igraph-0.9.1-c.html
This commit is contained in:
Martin Weinelt 2021-05-07 22:33:13 +02:00 committed by GitHub
parent 7275540666
commit 2d64c6d79b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,15 +77,17 @@ stdenv.mkDerivation rec {
"-DIGRAPH_USE_INTERNAL_GMP=OFF"
"-DIGRAPH_GLPK_SUPPORT=ON"
"-DIGRAPH_GRAPHML_SUPPORT=ON"
"-DIGRAPH_ENABLE_LTO=ON"
"-DIGRAPH_ENABLE_LTO=AUTO"
"-DIGRAPH_ENABLE_TLS=ON"
"-DBUILD_SHARED_LIBS=ON"
];
doCheck = true;
preCheck = ''
# needed to find libigraph.so
# needed to find libigraph, and liblas on darwin
preCheck = if stdenv.isDarwin then ''
export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [ blas ]}:$PWD/src"
'' else ''
export LD_LIBRARY_PATH="$PWD/src"
'';