File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -34,14 +34,6 @@ find_package(LibXml2 REQUIRED)
3434include (SwiftSupport)
3535include (GNUInstallDirs)
3636
37- if (CMAKE_SYSTEM_NAME STREQUAL Linux)
38- include (CheckSymbolExists)
39- include (CheckIncludeFile)
40- list (APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
41- check_include_file("sched.h" HAVE_SCHED_H)
42- check_symbol_exists(sched_getaffinity "sched.h" HAVE_SCHED_GETAFFINITY)
43- endif ()
44-
4537string (TOLOWER ${CMAKE_SYSTEM_NAME} swift_os)
4638get_swift_host_arch(swift_arch)
4739
Original file line number Diff line number Diff line change @@ -368,6 +368,17 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux OR CMAKE_SYSTEM_NAME STREQUAL Android)
368368 target_compile_definitions (CFXMLInterface
369369 PRIVATE
370370 -D_GNU_SOURCE)
371+
372+ if (CMAKE_SYSTEM_NAME STREQUAL Linux)
373+ include (CheckSymbolExists)
374+ include (CheckIncludeFile)
375+ list (APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
376+ check_include_file("sched.h" HAVE_SCHED_H)
377+ if (HAVE_SCHED_H)
378+ check_symbol_exists(sched_getaffinity "sched.h" HAVE_SCHED_GETAFFINITY)
379+ endif ()
380+ endif ()
381+
371382 if (HAVE_SCHED_GETAFFINITY)
372383 target_compile_definitions (CoreFoundation
373384 PRIVATE
You can’t perform that action at this time.
0 commit comments