|
@@ -1,7 +1,10 @@
|
|
|
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
|
|
|
|
-cmake_minimum_required(VERSION 2.8...3.18)
|
|
|
|
|
|
|
+cmake_minimum_required(VERSION 3.14)
|
|
|
|
|
+
|
|
|
|
|
+include(CheckPIESupported)
|
|
|
|
|
+
|
|
|
project(socket_api_sample)
|
|
project(socket_api_sample)
|
|
|
|
|
|
|
|
#######################################
|
|
#######################################
|
|
@@ -170,7 +173,6 @@ set(WAMR_BUILD_LIBC_WASI 1)
|
|
|
set(WAMR_BUILD_LIB_PTHREAD 1)
|
|
set(WAMR_BUILD_LIB_PTHREAD 1)
|
|
|
|
|
|
|
|
# compiling and linking flags
|
|
# compiling and linking flags
|
|
|
-set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie -fPIE")
|
|
|
|
|
if (NOT (CMAKE_C_COMPILER MATCHES ".*clang.*" OR CMAKE_C_COMPILER_ID MATCHES ".*Clang"))
|
|
if (NOT (CMAKE_C_COMPILER MATCHES ".*clang.*" OR CMAKE_C_COMPILER_ID MATCHES ".*Clang"))
|
|
|
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
|
|
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
|
|
|
endif ()
|
|
endif ()
|
|
@@ -188,4 +190,6 @@ set (RUNTIME_SOURCE_ALL
|
|
|
${UNCOMMON_SHARED_SOURCE}
|
|
${UNCOMMON_SHARED_SOURCE}
|
|
|
)
|
|
)
|
|
|
add_executable (iwasm ${RUNTIME_SOURCE_ALL})
|
|
add_executable (iwasm ${RUNTIME_SOURCE_ALL})
|
|
|
|
|
+check_pie_supported()
|
|
|
|
|
+set_target_properties (iwasm PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
|
target_link_libraries(iwasm vmlib -lpthread -lm -ldl)
|
|
target_link_libraries(iwasm vmlib -lpthread -lm -ldl)
|