File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,14 @@ if(BUILD_SHARED_LIBS)
6363 option (FOUNDATION_BUILD_TOOLS "build tools" ON )
6464endif ()
6565
66+ set (FOUNDATION_BUILD_NETWORKING_default ON )
67+ if (CMAKE_SYSTEM_NAME STREQUAL WASI)
68+ # Networking is not supported on WASI
69+ set (FOUNDATION_BUILD_NETWORKING_default OFF )
70+ endif ()
71+ option (FOUNDATION_BUILD_NETWORKING "build FoundationNetworking"
72+ ${FOUNDATION_BUILD_NETWORKING_default} )
73+
6674set (CMAKE_POSITION_INDEPENDENT_CODE YES )
6775
6876# Fetchable dependcies
@@ -121,7 +129,9 @@ if(NOT CMAKE_SYSTEM_NAME STREQUAL WASI)
121129 endif ()
122130endif ()
123131find_package (LibXml2 REQUIRED)
124- find_package (CURL REQUIRED)
132+ if (FOUNDATION_BUILD_NETWORKING)
133+ find_package (CURL REQUIRED)
134+ endif ()
125135
126136# Common build flags (_CFURLSessionInterface, _CFXMLInterface, CoreFoundation)
127137list (APPEND _Foundation_common_build_flags
Original file line number Diff line number Diff line change 1414
1515add_subdirectory (CoreFoundation)
1616add_subdirectory (_CFXMLInterface)
17- if (NOT CMAKE_SYSTEM_NAME STREQUAL "WASI" )
17+ if (FOUNDATION_BUILD_NETWORKING )
1818 add_subdirectory (_CFURLSessionInterface)
1919endif ()
2020add_subdirectory (Foundation)
2121add_subdirectory (FoundationXML)
22- if (NOT CMAKE_SYSTEM_NAME STREQUAL "WASI" )
22+ if (FOUNDATION_BUILD_NETWORKING )
2323 add_subdirectory (FoundationNetworking)
2424endif ()
2525if (FOUNDATION_BUILD_TOOLS)
You can’t perform that action at this time.
0 commit comments