@@ -38,7 +38,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
38
38
endif ()
39
39
40
40
include (CheckSourceCompiles)
41
- include (CheckSourceRuns)
42
41
include (CheckSymbolExists)
43
42
include (CheckTypeSize)
44
43
include (CMakeDependentOption)
@@ -217,47 +216,30 @@ if(HAVE_PHP_EXT_PCNTL_STRUCT_SIGINFO_T)
217
216
target_compile_definitions (php_ext_pcntl PRIVATE HAVE_STRUCT_SIGINFO_T)
218
217
endif ()
219
218
219
+ # Check if sched_getcpu() is supported. Value -1 means ENOSYS in this context.
220
220
cmake_push_check_state(RESET)
221
221
set (CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
222
222
223
- # Check if sched_getcpu() is supported. Value -1 means ENOSYS in this context.
224
- block(PROPAGATE HAVE_SCHED_GETCPU)
225
- php_search_libraries(
226
- SYMBOL sched_getcpu
227
- HEADERS sched.h
228
- LIBRARIES
229
- gnu # Haiku
230
- RESULT_VARIABLE PHP_EXT_PCNTL_HAVE_SCHED_GETCPU_SYMBOL
231
- LIBRARY_VARIABLE PHP_EXT_PCNTL_HAVE_SCHED_GETCPU_LIBRARY
232
- )
233
-
234
- if (PHP_EXT_PCNTL_HAVE_SCHED_GETCPU_SYMBOL)
235
- if (PHP_EXT_PCNTL_HAVE_SCHED_GETCPU_LIBRARY)
236
- set (CMAKE_REQUIRED_LIBRARIES ${PHP_EXT_PCNTL_HAVE_SCHED_GETCPU_LIBRARY} )
237
- endif ()
238
- check_source_runs(C [[
239
- #include <sched.h>
240
- int main(void)
241
- {
242
- if (sched_getcpu() == -1) {
243
- return 1;
244
- }
245
- return 0;
223
+ php_search_libraries(
224
+ SOURCE_RUNS [[
225
+ #include <sched.h>
226
+ int main(void)
227
+ {
228
+ if (sched_getcpu() == -1) {
229
+ return 1;
246
230
}
247
- ]] PHP_EXT_PCNTL_HAVE_SCHED_GETCPU)
248
- endif ()
249
-
250
- if (PHP_EXT_PCNTL_HAVE_SCHED_GETCPU)
251
- if (PHP_EXT_PCNTL_HAVE_SCHED_GETCPU_LIBRARY)
252
- target_link_libraries (
253
- php_ext_pcntl
254
- PRIVATE ${ PHP_EXT_PCNTL_HAVE_SCHED_GETCPU_LIBRARY}
255
- )
256
- endif ( )
231
+ return 0;
232
+ }
233
+ ]]
234
+ HEADERS sched.h
235
+ LIBRARIES
236
+ gnu # Haiku
237
+ RESULT_VARIABLE PHP_EXT_PCNTL_HAVE_SCHED_GETCPU
238
+ LIBRARY_VARIABLE PHP_EXT_PCNTL_HAVE_SCHED_GETCPU_LIBRARY
239
+ TARGET php_ext_pcntl PRIVATE
240
+ )
257
241
258
- set (HAVE_SCHED_GETCPU TRUE )
259
- endif ()
260
- endblock()
242
+ set (HAVE_SCHED_GETCPU ${PHP_EXT_PCNTL_HAVE_SCHED_GETCPU} )
261
243
cmake_pop_check_state()
262
244
263
245
configure_file (cmake/config.h.in config.h)
0 commit comments