set default value of WAMR_BUILD_REF_TYPES to 1 in standalone cases (#4227)

- set default value of WAMR_BUILD_REF_TYPES to 1 in CMakeLists.txt
This commit is contained in:
Liu Jia
2025-04-30 14:10:56 +08:00
committed by GitHub
parent a9966897b6
commit 9773390537
5 changed files with 16 additions and 4 deletions

View File

@ -11,10 +11,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
project(c_embed_test)
cmake_minimum_required(VERSION 3.14)
project(c_embed_test)
include(CheckPIESupported)
string (TOLOWER ${CMAKE_HOST_SYSTEM_NAME} WAMR_BUILD_PLATFORM)
@ -34,6 +34,11 @@ set(WAMR_BUILD_LIBC_WASI 1)
set(WAMR_BUILD_SIMD 1)
set(WAMR_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../..)
if (NOT DEFINED WAMR_BUILD_REF_TYPES)
# Enable reference types by default
set (WAMR_BUILD_REF_TYPES 1)
endif ()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}")
if (NOT WAMR_BUILD_PLATFORM STREQUAL "darwin")
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections -pie -fPIE")