@@ -21,29 +21,43 @@ numpy = ">=1.22.0"
2121python = " >=3.9.0"
2222scipy = " >=1.10.0"
2323
24- [activation ]
25- scripts = [" development/scripts// pixi/activation.sh" ]
24+ [target . unix . activation ]
25+ scripts = [" development/scripts/pixi/activation.sh" ]
2626
2727[target .win-64 .activation ]
28- scripts = [" development/scripts//pixi/activation.bat" ]
28+ scripts = [" development/scripts/pixi/activation.bat" ]
29+
30+ [activation .env ]
31+ # Setup ccache
32+ CMAKE_CXX_COMPILER_LAUNCHER = " ccache"
33+ # Create compile_commands.json for language server
34+ CMAKE_EXPORT_COMPILE_COMMANDS = " ON"
35+ # Activate color output with Ninja
36+ CMAKE_COLOR_DIAGNOSTICS = " ON"
2937
3038[tasks ]
3139# We must avoid to set CMAKE_CXX_FLAGS because of WIN32
3240# https://discourse.cmake.org/t/strictly-appending-to-cmake-lang-flags/6478
33- configure = { cmd = [
41+ configure = { args = [
42+ { arg = " build_dir" , default = " build" },
43+ { arg = " build_type" , default = " $EIGENPY_BUILD_TYPE" },
44+ { arg = " python_stubs" , default = " $EIGENPY_PYTHON_STUBS" },
45+ { arg = " cholmod_support" , default = " $EIGENPY_CHOLMOD_SUPPORT" },
46+ { arg = " accelerate_support" , default = " $EIGENPY_ACCELERATE_SUPPORT" },
47+ ], cmd = [
3448 " CXXFLAGS=$EIGENPY_CXX_FLAGS" ,
3549 " cmake" ,
3650 " -G" ,
3751 " Ninja" ,
3852 " -B" ,
39- " build " ,
53+ " {{ build_dir }} " ,
4054 " -S" ,
4155 " ." ,
4256 " -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX" ,
43- " -DCMAKE_BUILD_TYPE=$EIGENPY_BUILD_TYPE " ,
44- " -DGENERATE_PYTHON_STUBS=$EIGENPY_PYTHON_STUBS " ,
45- " -DBUILD_WITH_CHOLMOD_SUPPORT=$EIGENPY_CHOLMOD_SUPPORT " ,
46- " -DBUILD_WITH_ACCELERATE_SUPPORT=$EIGENPY_ACCELERATE_SUPPORT " ,
57+ " -DCMAKE_BUILD_TYPE={{ build_type }} " ,
58+ " -DGENERATE_PYTHON_STUBS={{ python_stubs }} " ,
59+ " -DBUILD_WITH_CHOLMOD_SUPPORT={{ cholmod_support }} " ,
60+ " -DBUILD_WITH_ACCELERATE_SUPPORT={{ accelerate_support }} " ,
4761] }
4862build = { cmd = " cmake --build build --target all" , depends-on = [" configure" ] }
4963clean = { cmd = " rm -rf build" }
@@ -60,23 +74,14 @@ tasks = { lint = { cmd = "pre-commit run --all" } }
6074tomlkit = " >=0.13.2"
6175
6276[feature .new-version .tasks ]
63- configure_new_version = { cmd = [
64- " CXXFLAGS=$EIGENPY_CXX_FLAGS" ,
65- " cmake" ,
66- " -G" ,
67- " Ninja" ,
68- " -B" ,
69- " build_new_version" ,
70- " -S" ,
71- " ." ,
72- " -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX" ,
73- " -DCMAKE_BUILD_TYPE=$EIGENPY_BUILD_TYPE" ,
74- " -DGENERATE_PYTHON_STUBS=ON" ,
75- " -DBUILD_WITH_CHOLMOD_SUPPORT=ON" ,
76- " -DBUILD_WITH_ACCELERATE_SUPPORT=OFF" ,
77- ] }
78- release_new_version = { cmd = " VERSION=$EIGENPY_VERSION cmake --build build_new_version --target release" , depends-on = [
79- " configure_new_version" ,
77+ release-new-version = { cmd = " VERSION=$EIGENPY_VERSION cmake --build build_new_version --target release" , depends-on = [
78+ { task = " configure" , args = [
79+ { build_type = " Release" },
80+ { build_directory = " build_new_version" },
81+ { python_stubs = " ON" },
82+ { accelerate_support = " OFF" },
83+ { cholmod_support = " ON" },
84+ ] },
8085] }
8186
8287# Cholmod support
@@ -95,19 +100,16 @@ python = "3.14.*"
95100[feature .python-oldest .dependencies ]
96101python = " 3.10.*"
97102
98- # Use clang-cl on Windows.
99- # We must use scripts instead of env to setup CC and CXX
100- # to avoid cxx-compiler to overwrite them.
103+ # Use clang-cl on Windows
101104[feature .clang-cl ]
102105platforms = [" win-64" ]
103- activation = { scripts = [" development/scripts//pixi/activation_clang_cl.bat" ] }
106+ activation = { env = { CC = " clang-cl" , CXX = " clang-cl" } }
107+ dependencies = { clangxx = " *" }
104108
105- # Use clang on GNU/Linux.
106- # We must use scripts instead of env to setup CC and CXX
107- # to avoid cxx-compiler to overwrite them.
109+ # Use clang on GNU/Linux
108110[feature .clang ]
109111platforms = [" linux-64" ]
110- activation = { scripts = [ " development/scripts//pixi/activation_clang.sh " ] }
112+ activation = { env = { CC = " clang " , CXX = " clang++ " } }
111113dependencies = { clangxx = " *" }
112114
113115[environments ]
0 commit comments