From eb3497a63a21c1589c333939733685662bc9cdeb Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Sun, 31 Jan 2021 22:17:25 +0800 Subject: [PATCH] Using C_STANDARD 99 Use consistence CMAKE_TOOLCHAIN_FILE Signed-off-by: Yonggang Luo --- cmake/iotjs.cmake | 3 ++- cmake/libtuv.cmake | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cmake/iotjs.cmake b/cmake/iotjs.cmake index 187ad6f503..0195a64494 100644 --- a/cmake/iotjs.cmake +++ b/cmake/iotjs.cmake @@ -350,7 +350,7 @@ endforeach() iotjs_add_compile_flags(-Wall) if(NOT USING_MSVC) iotjs_add_compile_flags(-Wextra -Werror -Wno-unused-parameter) - iotjs_add_compile_flags(-Wsign-conversion -std=gnu99) + iotjs_add_compile_flags(-Wno-sizeof-pointer-memaccess -Wno-unused-variable) endif() if(ENABLE_SNAPSHOT) @@ -536,6 +536,7 @@ set_target_properties(${TARGET_LIB_IOTJS} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib" PUBLIC_HEADER "${IOTJS_PUBLIC_HEADERS}" + C_STANDARD 99 ) target_include_directories(${TARGET_LIB_IOTJS} PRIVATE ${IOTJS_INCLUDE_DIRS}) diff --git a/cmake/libtuv.cmake b/cmake/libtuv.cmake index ef93573855..a626e4ee8f 100644 --- a/cmake/libtuv.cmake +++ b/cmake/libtuv.cmake @@ -22,9 +22,6 @@ if("${TARGET_OS}" STREQUAL "MOCK") else() string(TOLOWER ${TARGET_ARCH}-${TARGET_OS} PLATFORM_DESCRIPTOR) endif() -set(DEPS_TUV_TOOLCHAIN - ${DEPS_TUV_SRC}/cmake/config/config_${PLATFORM_DESCRIPTOR}.cmake) -message(STATUS "libtuv toolchain file: ${DEPS_TUV_TOOLCHAIN}") ExternalProject_Add(libtuv PREFIX ${DEPS_TUV} SOURCE_DIR ${DEPS_TUV_SRC} @@ -35,7 +32,7 @@ ExternalProject_Add(libtuv ${CMAKE_BINARY_DIR}/${DEPS_TUV}/lib/${CONFIG_TYPE}/ ${CMAKE_BINARY_DIR}/lib/ CMAKE_ARGS - -DCMAKE_TOOLCHAIN_FILE=${DEPS_TUV_TOOLCHAIN} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DTARGET_PLATFORM=${PLATFORM_DESCRIPTOR}