Fix compile error when build target X86_32 (#869)

Fix compile error introduced by #866.
This commit is contained in:
Wenyong Huang 2021-12-06 19:01:09 +08:00 committed by GitHub
parent b490a229f6
commit a5193686f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,8 +62,8 @@ if (CMAKE_SIZEOF_VOID_P EQUAL 8)
endif ()
else ()
include(CheckCCompilerFlag)
Check_C_Compiler_Flag( -m32 M32_OK )
if (M32_OK)
Check_C_Compiler_Flag(-m32 M32_OK)
if (M32_OK OR WAMR_BUILD_TARGET STREQUAL "X86_32")
add_definitions (-m32)
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32")