From: Lasse Collin Date: Mon, 31 Oct 2022 09:49:47 +0000 (+0200) Subject: CMake: Sync tuklib_cpucores.cmake with tuklib_cpucores.m4. X-Git-Tag: v5.2.8~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c8cbb5be3a97bf22e933777369c4cc28ef9ed5f;p=thirdparty%2Fxz.git CMake: Sync tuklib_cpucores.cmake with tuklib_cpucores.m4. This was forgotten from commit 2611c4d90535652d3eb7ef4a026a6691276fab43. --- diff --git a/cmake/tuklib_cpucores.cmake b/cmake/tuklib_cpucores.cmake index 743d56b3..ea16e427 100644 --- a/cmake/tuklib_cpucores.cmake +++ b/cmake/tuklib_cpucores.cmake @@ -89,7 +89,12 @@ function(tuklib_cpucores_internal_check) #include int main(void) { + #ifdef HW_NCPUONLINE + /* This is preferred on OpenBSD, see tuklib_cpucores.c. */ + int name[2] = { CTL_HW, HW_NCPUONLINE }; + #else int name[2] = { CTL_HW, HW_NCPU }; + #endif int cpus; size_t cpus_size = sizeof(cpus); sysctl(name, 2, &cpus, &cpus_size, NULL, 0);