pocl: tweak configure flags

This commit is contained in:
Aleix Boné 2025-10-08 16:35:47 +02:00
parent 3bbf6a3d6e
commit b3f2199ab6
No known key found for this signature in database

View File

@ -103,11 +103,10 @@ stdenv.mkDerivation (finalAttrs: {
(lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck) (lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck)
(lib.cmakeBool "ENABLE_RELOCATION" true) (lib.cmakeBool "ENABLE_RELOCATION" true)
(lib.cmakeBool "ENABLE_POCL_BUILDING" false) (lib.cmakeBool "ENABLE_POCL_BUILDING" true)
(lib.cmakeBool "POCL_ICD_ABSOLUTE_PATH" true)
(lib.cmakeBool "ENABLE_TBB_DEVICE" enableTBB) (lib.cmakeBool "ENABLE_TBB_DEVICE" enableTBB)
(lib.cmakeBool "ENABLE_OVNI" enableOVNI)
(lib.cmakeBool "ENABLE_NOSV" enableNOSV)
(lib.cmakeBool "ENABLE_ICD" enableICD) (lib.cmakeBool "ENABLE_ICD" enableICD)
(lib.cmakeBool "ENABLE_HWLOC" enableHWLOC) (lib.cmakeBool "ENABLE_HWLOC" enableHWLOC)
(lib.cmakeBool "ENABLE_LTTNG" enableLTTNG) (lib.cmakeBool "ENABLE_LTTNG" enableLTTNG)
@ -117,6 +116,9 @@ stdenv.mkDerivation (finalAttrs: {
# avoid the runtime linker pulling in a different llvm e.g. from graphics drivers # avoid the runtime linker pulling in a different llvm e.g. from graphics drivers
(lib.cmakeBool "STATIC_LLVM" staticLLVM) (lib.cmakeBool "STATIC_LLVM" staticLLVM)
] ++ lib.optionals (enableNOSV || enableOVNI) [
(lib.cmakeBool "ENABLE_NOSV" enableNOSV)
(lib.cmakeBool "ENABLE_OVNI" enableOVNI)
] ++ lib.optionals (!isCross && enableDistroVariants) [ ] ++ lib.optionals (!isCross && enableDistroVariants) [
(lib.cmakeFeature "KERNELLIB_HOST_CPU_VARIANTS" "distro") # TODO: check if we can do it when cross compiling (lib.cmakeFeature "KERNELLIB_HOST_CPU_VARIANTS" "distro") # TODO: check if we can do it when cross compiling
] ++ lib.optionals isCross [ ] ++ lib.optionals isCross [
@ -136,6 +138,7 @@ stdenv.mkDerivation (finalAttrs: {
preConfigure = '' preConfigure = ''
cmakeFlagsArray+=( cmakeFlagsArray+=(
-DEXTRA_HOST_LD_FLAGS="${lib.escapeShellArg (builtins.readFile "${stdenv.cc}/nix-support/cc-ldflags")}" -DEXTRA_HOST_LD_FLAGS="${lib.escapeShellArg (builtins.readFile "${stdenv.cc}/nix-support/cc-ldflags")}"
-DEXTRA_KERNEL_FLAGS="${lib.escapeShellArg (builtins.readFile "${stdenv.cc}/nix-support/cc-ldflags")}"
) )
'' + lib.optionalString stdenv.hostPlatform.isRiscV '' '' + lib.optionalString stdenv.hostPlatform.isRiscV ''
cmakeFlagsArray+=( cmakeFlagsArray+=(