uvwasi: fix old version build, add new version (#3434)
* uvwasi: fix old version build, add new version * fix * add patch * add alias for glibtoolize * fixpull/3445/head
parent
142a581326
commit
f813e79e73
3 changed files with 108 additions and 18 deletions
@ -0,0 +1,71 @@ |
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 5a5e87c..48db2d6 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -20,7 +20,7 @@ cmake_dependent_option(UVWASI_BUILD_TESTS
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out)
|
||||
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU")
|
||||
- list(APPEND uvwasi_cflags -fvisibility=hidden --std=gnu89)
|
||||
+ list(APPEND uvwasi_cflags --std=gnu89)
|
||||
list(APPEND uvwasi_cflags -Wall -Wsign-compare -Wextra -Wstrict-prototypes)
|
||||
list(APPEND uvwasi_cflags -Wno-unused-parameter)
|
||||
endif()
|
||||
@@ -33,27 +33,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||
list(APPEND uvwasi_defines _GNU_SOURCE _POSIX_C_SOURCE=200112)
|
||||
endif()
|
||||
|
||||
-find_package(LIBUV QUIET)
|
||||
-if(LIBUV_FOUND)
|
||||
- include_directories(${LIBUV_INCLUDE_DIR})
|
||||
-else()
|
||||
- include(FetchContent)
|
||||
- ## https://libuv.org
|
||||
- FetchContent_Declare(
|
||||
- libuv
|
||||
- GIT_REPOSITORY https://github.com/libuv/libuv.git
|
||||
- GIT_TAG ${LIBUV_VERSION})
|
||||
-
|
||||
- FetchContent_GetProperties(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()
|
||||
- set(LIBUV_INCLUDE_DIR ${libuv_SOURCE_DIR}/include)
|
||||
- set(LIBUV_LIBRARIES uv_a)
|
||||
-endif()
|
||||
-
|
||||
## uvwasi source code files.
|
||||
set(uvwasi_sources
|
||||
src/clocks.c
|
||||
@@ -97,19 +76,7 @@ if(ASAN AND CMAKE_C_COMPILER_ID MATCHES "AppleClang|GNU|Clang")
|
||||
set (CMAKE_LINKER_FLAGS_DEBUG "${CMAKE_LINKER_FLAGS_DEBUG} -fno-omit-frame-pointer -fsanitize=address")
|
||||
endif()
|
||||
|
||||
-## Static library target.
|
||||
-add_library(uvwasi_a STATIC ${uvwasi_sources})
|
||||
-target_compile_definitions(uvwasi_a PRIVATE ${uvwasi_defines})
|
||||
-target_compile_options(uvwasi_a PRIVATE ${uvwasi_cflags})
|
||||
-target_include_directories(uvwasi_a PRIVATE ${PROJECT_SOURCE_DIR}/include)
|
||||
-if(CODE_COVERAGE)
|
||||
- target_link_libraries(uvwasi_a PUBLIC ${LIBUV_LIBRARIES} coverage_config)
|
||||
-else()
|
||||
- target_link_libraries(uvwasi_a PRIVATE ${LIBUV_LIBRARIES})
|
||||
-endif()
|
||||
-
|
||||
-## Shared library target.
|
||||
-add_library(uvwasi SHARED ${uvwasi_sources})
|
||||
+add_library(uvwasi ${uvwasi_sources})
|
||||
target_compile_definitions(uvwasi PRIVATE ${uvwasi_defines})
|
||||
target_compile_options(uvwasi PRIVATE ${uvwasi_cflags})
|
||||
target_include_directories(uvwasi PRIVATE ${PROJECT_SOURCE_DIR}/include)
|
||||
@@ -159,7 +126,7 @@ if(INSTALL_UVWASI AND NOT CODE_COVERAGE)
|
||||
configure_package_config_file(${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in ${config_file} INSTALL_DESTINATION ${cmake_files_install_dir})
|
||||
|
||||
install(
|
||||
- TARGETS uvwasi_a uvwasi
|
||||
+ TARGETS uvwasi
|
||||
EXPORT ${target_export_name}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
Loading…
Reference in new issue