Skip to content

Commit 4873dd1

Browse files
committed
Improve cross-compiling for sched_getcpu check
1 parent b31fba0 commit 4873dd1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

cmake/cmake/toolchains/template.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,6 @@ set(ZEND_CHECK_STACK_LIMIT_EXITCODE 1)
6060

6161
# Set to exit code of the ttyname_r check.
6262
set(HAVE_TTYNAME_R_EXITCODE 0)
63+
64+
# Set to exit code of the sched_getcpu check.
65+
set(HAVE_SCHED_GETCPU_EXITCODE 0)

cmake/ext/pcntl/CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,14 @@ cmake_push_check_state(RESET)
141141
LIBRARY_VARIABLE library
142142
)
143143

144-
if(_HAVE_SCHED_GETCPU AND NOT CMAKE_CROSSCOMPILING)
144+
if(_HAVE_SCHED_GETCPU)
145145
if(library)
146146
set(CMAKE_REQUIRED_LIBRARIES ${library})
147147
endif()
148148
check_source_runs(C [[
149149
#include <sched.h>
150-
int main(void) {
150+
int main(void)
151+
{
151152
if (sched_getcpu() == -1) {
152153
return 1;
153154
}

0 commit comments

Comments
 (0)