experimental/cmake-improvement
set CMAKE_LIBRARY_PATH, CMAKE_INCLUDE_PATH based on NIX_CFLAGS_COMPILE and NIX_LDFLAGS so that cmake's find_library like functions find all the libraries gcc knows about thanks to the gcc wrapper This is particular useful with myEnvFun which then also sets those CMAKE_* env variables.` Because setup.sh has to change this causes many rebuilds - thus it should be included in a stdenv-update like branch Also cmake builds in parallel perfectly fine update cmake to latest minor number, I didn't change the patches, just reapplied them manually recordin a new patch
This commit is contained in:
@@ -56,3 +56,20 @@ if [ -n "$crossConfig" ]; then
|
||||
else
|
||||
envHooks+=(addCMakeParams)
|
||||
fi
|
||||
|
||||
make_cmake_find_libs(){
|
||||
for flag in $NIX_CFLAGS_COMPILE $NIX_LDFLAGS; do
|
||||
case $flag in
|
||||
-I*)
|
||||
export CMAKE_INCLUDE_PATH="$CMAKE_INCLUDE_PATH${CMAKE_INCLUDE_PATH:+:}${flag:2}"
|
||||
;;
|
||||
-L*)
|
||||
export CMAKE_LIBRARY_PATH="$CMAKE_LIBRARY_PATH${CMAKE_LIBRARY_PATH:+:}${flag:2}"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# not using setupHook, because it could be a setupHook adding additional
|
||||
# include flags to NIX_CFLAGS_COMPILE
|
||||
postHooks+=(make_cmake_find_libs)
|
||||
|
||||
Reference in New Issue
Block a user