Skip to content

Commit

Permalink
Update uvwasi CMakeLists.txt
Browse files Browse the repository at this point in the history
FetchContent_Populate is deprecated, updated the cmake file to use
FetchContent_MakeAvailable.
Also updated minimum cmake version for FetchContent_MakeAvailable
compatibility.
Also fix a bug where the flag '-m32' was not added when building in 32
bit mode.

Signed-off-by: Ádám László Kulcsár <[email protected]>
  • Loading branch information
kulcsaradam committed Jul 24, 2024
1 parent 7800a31 commit 94ebdad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions third_party/uvwasi/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.11)
cmake_minimum_required(VERSION 3.14)
project (
uvwasi
DESCRIPTION "WASI syscall API built atop libuv"
Expand Down Expand Up @@ -29,7 +29,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU")

if (UVWASI_BUILD_X86)
# set x86 build flag
add_compile_options( -m32 )
set (CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -m32)
endif()
endif()

Expand All @@ -53,8 +53,8 @@ endif()
GIT_TAG ${LIBUV_VERSION})

FetchContent_GetProperties(libuv)
FetchContent_MakeAvailable(libuv)
if(NOT libuv_POPULATED)
FetchContent_Populate(libuv)
include_directories("${libuv_SOURCE_DIR}/include")
add_subdirectory(${libuv_SOURCE_DIR} ${libuv_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
Expand Down

0 comments on commit 94ebdad

Please sign in to comment.