diff --git a/CMakeLists.txt b/CMakeLists.txt index 2582b4926..a2abac7ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,9 +25,11 @@ if (NOT DEFINED WAMR_BUILD_TARGET) elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) # Build as X86_64 by default in 64-bit platform set (WAMR_BUILD_TARGET "X86_64") - else () + elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # Build as X86_32 by default in 32-bit platform set (WAMR_BUILD_TARGET "X86_32") + else () + message(SEND_ERROR "Unsupported build target platform!") endif () endif () diff --git a/build-scripts/runtime_lib.cmake b/build-scripts/runtime_lib.cmake index e7f7860cf..ff714b132 100644 --- a/build-scripts/runtime_lib.cmake +++ b/build-scripts/runtime_lib.cmake @@ -41,9 +41,11 @@ if (NOT DEFINED WAMR_BUILD_TARGET) elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) # Build as X86_64 by default in 64-bit platform set (WAMR_BUILD_TARGET "X86_64") - else () + elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # Build as X86_32 by default in 32-bit platform set (WAMR_BUILD_TARGET "X86_32") + else () + message(SEND_ERROR "Unsupported build target platform!") endif () endif () diff --git a/product-mini/platforms/android/CMakeLists.txt b/product-mini/platforms/android/CMakeLists.txt index c59f98c0d..b20011023 100644 --- a/product-mini/platforms/android/CMakeLists.txt +++ b/product-mini/platforms/android/CMakeLists.txt @@ -35,9 +35,11 @@ if (NOT DEFINED WAMR_BUILD_TARGET) if (CMAKE_SIZEOF_VOID_P EQUAL 8) # Build as X86_64 by default in 64-bit platform set (WAMR_BUILD_TARGET "X86_64") - else () + elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # Build as X86_32 by default in 32-bit platform set (WAMR_BUILD_TARGET "X86_32") + else () + message(SEND_ERROR "Unsupported build target platform!") endif () endif () diff --git a/product-mini/platforms/darwin/CMakeLists.txt b/product-mini/platforms/darwin/CMakeLists.txt index 6485b5903..588b5d166 100644 --- a/product-mini/platforms/darwin/CMakeLists.txt +++ b/product-mini/platforms/darwin/CMakeLists.txt @@ -22,9 +22,11 @@ if (NOT DEFINED WAMR_BUILD_TARGET) elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) # Build as X86_64 by default in 64-bit platform set (WAMR_BUILD_TARGET "X86_64") - else () + elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # Build as X86_32 by default in 32-bit platform set (WAMR_BUILD_TARGET "X86_32") + else () + message(SEND_ERROR "Unsupported build target platform!") endif () endif () diff --git a/product-mini/platforms/linux-sgx/CMakeLists.txt b/product-mini/platforms/linux-sgx/CMakeLists.txt index 286d90596..6a06c061e 100644 --- a/product-mini/platforms/linux-sgx/CMakeLists.txt +++ b/product-mini/platforms/linux-sgx/CMakeLists.txt @@ -16,9 +16,11 @@ if (NOT DEFINED WAMR_BUILD_TARGET) if (CMAKE_SIZEOF_VOID_P EQUAL 8) # Build as X86_64 by default in 64-bit platform set (WAMR_BUILD_TARGET "X86_64") - else () + elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # Build as X86_32 by default in 32-bit platform set (WAMR_BUILD_TARGET "X86_32") + else () + message(SEND_ERROR "Unsupported build target platform!") endif () endif () diff --git a/product-mini/platforms/linux-sgx/CMakeLists_minimal.txt b/product-mini/platforms/linux-sgx/CMakeLists_minimal.txt index 336757401..9a33f8b47 100644 --- a/product-mini/platforms/linux-sgx/CMakeLists_minimal.txt +++ b/product-mini/platforms/linux-sgx/CMakeLists_minimal.txt @@ -16,9 +16,11 @@ if (NOT DEFINED WAMR_BUILD_TARGET) if (CMAKE_SIZEOF_VOID_P EQUAL 8) # Build as X86_64 by default in 64-bit platform set (WAMR_BUILD_TARGET "X86_64") - else () + elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # Build as X86_32 by default in 32-bit platform set (WAMR_BUILD_TARGET "X86_32") + else () + message(SEND_ERROR "Unsupported build target platform!") endif () endif () diff --git a/product-mini/platforms/linux/CMakeLists.txt b/product-mini/platforms/linux/CMakeLists.txt index c0b6f6a8c..542d27716 100644 --- a/product-mini/platforms/linux/CMakeLists.txt +++ b/product-mini/platforms/linux/CMakeLists.txt @@ -25,9 +25,11 @@ if (NOT DEFINED WAMR_BUILD_TARGET) elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) # Build as X86_64 by default in 64-bit platform set (WAMR_BUILD_TARGET "X86_64") - else () + elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # Build as X86_32 by default in 32-bit platform set (WAMR_BUILD_TARGET "X86_32") + else () + message(SEND_ERROR "Unsupported build target platform!") endif () endif () diff --git a/product-mini/platforms/vxworks/CMakeLists.txt b/product-mini/platforms/vxworks/CMakeLists.txt index d681e9213..f15eb0594 100644 --- a/product-mini/platforms/vxworks/CMakeLists.txt +++ b/product-mini/platforms/vxworks/CMakeLists.txt @@ -24,9 +24,11 @@ if (NOT DEFINED WAMR_BUILD_TARGET) if (CMAKE_SIZEOF_VOID_P EQUAL 8) # Build as X86_64 by default in 64-bit platform set (WAMR_BUILD_TARGET "X86_64") - else () + elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # Build as X86_32 by default in 32-bit platform set (WAMR_BUILD_TARGET "X86_32") + else () + message(SEND_ERROR "Unsupported build target platform!") endif () endif () diff --git a/product-mini/platforms/windows/CMakeLists.txt b/product-mini/platforms/windows/CMakeLists.txt index bc82c8221..34f280fa5 100644 --- a/product-mini/platforms/windows/CMakeLists.txt +++ b/product-mini/platforms/windows/CMakeLists.txt @@ -23,9 +23,11 @@ if (NOT DEFINED WAMR_BUILD_TARGET) if (CMAKE_SIZEOF_VOID_P EQUAL 8) # Build as X86_64 by default in 64-bit platform set (WAMR_BUILD_TARGET "X86_64") - else () + elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # Build as X86_32 by default in 32-bit platform set (WAMR_BUILD_TARGET "X86_32") + else () + message(FATAL_ERROR "Unsupported build target platform!") endif () endif () diff --git a/samples/basic/CMakeLists.txt b/samples/basic/CMakeLists.txt index 7e10d4609..d408774da 100644 --- a/samples/basic/CMakeLists.txt +++ b/samples/basic/CMakeLists.txt @@ -33,9 +33,11 @@ if (NOT DEFINED WAMR_BUILD_TARGET) elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) # Build as X86_64 by default in 64-bit platform set (WAMR_BUILD_TARGET "X86_64") - else () + elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # Build as X86_32 by default in 32-bit platform set (WAMR_BUILD_TARGET "X86_32") + else () + message(SEND_ERROR "Unsupported build target platform!") endif () endif () diff --git a/samples/multi-module/CMakeLists.txt b/samples/multi-module/CMakeLists.txt index e3edd0476..26c99d828 100644 --- a/samples/multi-module/CMakeLists.txt +++ b/samples/multi-module/CMakeLists.txt @@ -27,9 +27,11 @@ if (NOT DEFINED WAMR_BUILD_TARGET) elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) # Build as X86_64 by default in 64-bit platform set (WAMR_BUILD_TARGET "X86_64") - else () + elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # Build as X86_32 by default in 32-bit platform set (WAMR_BUILD_TARGET "X86_32") + else () + message(SEND_ERROR "Unsupported build target platform!") endif () endif () diff --git a/samples/multi-thread/CMakeLists.txt b/samples/multi-thread/CMakeLists.txt index 89c983862..63c14eebd 100644 --- a/samples/multi-thread/CMakeLists.txt +++ b/samples/multi-thread/CMakeLists.txt @@ -27,9 +27,11 @@ if (NOT DEFINED WAMR_BUILD_TARGET) elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) # Build as X86_64 by default in 64-bit platform set (WAMR_BUILD_TARGET "X86_64") - else () + elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # Build as X86_32 by default in 32-bit platform set (WAMR_BUILD_TARGET "X86_32") + else () + message(SEND_ERROR "Unsupported build target platform!") endif () endif () diff --git a/samples/native-lib/CMakeLists.txt b/samples/native-lib/CMakeLists.txt index 3968393c6..00eb40d94 100644 --- a/samples/native-lib/CMakeLists.txt +++ b/samples/native-lib/CMakeLists.txt @@ -27,9 +27,11 @@ if (NOT DEFINED WAMR_BUILD_TARGET) elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) # Build as X86_64 by default in 64-bit platform set (WAMR_BUILD_TARGET "X86_64") - else () + elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # Build as X86_32 by default in 32-bit platform set (WAMR_BUILD_TARGET "X86_32") + else () + message(SEND_ERROR "Unsupported build target platform!") endif () endif () diff --git a/samples/ref-types/CMakeLists.txt b/samples/ref-types/CMakeLists.txt index 229afd3c4..3aac01d42 100644 --- a/samples/ref-types/CMakeLists.txt +++ b/samples/ref-types/CMakeLists.txt @@ -33,9 +33,11 @@ if (NOT DEFINED WAMR_BUILD_TARGET) elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) # Build as X86_64 by default in 64-bit platform set (WAMR_BUILD_TARGET "X86_64") - else () + elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # Build as X86_32 by default in 32-bit platform set (WAMR_BUILD_TARGET "X86_32") + else () + message(SEND_ERROR "Unsupported build target platform!") endif () endif () diff --git a/samples/socket-api/CMakeLists.txt b/samples/socket-api/CMakeLists.txt index 936287c7d..5ce2543b9 100644 --- a/samples/socket-api/CMakeLists.txt +++ b/samples/socket-api/CMakeLists.txt @@ -125,9 +125,11 @@ if (NOT DEFINED WAMR_BUILD_TARGET) elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) # Build as X86_64 by default in 64-bit platform set (WAMR_BUILD_TARGET "X86_64") - else () + elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # Build as X86_32 by default in 32-bit platform set (WAMR_BUILD_TARGET "X86_32") + else () + message(SEND_ERROR "Unsupported build target platform!") endif () endif () diff --git a/samples/spawn-thread/CMakeLists.txt b/samples/spawn-thread/CMakeLists.txt index 794ec2aa2..16618e303 100644 --- a/samples/spawn-thread/CMakeLists.txt +++ b/samples/spawn-thread/CMakeLists.txt @@ -27,9 +27,11 @@ if (NOT DEFINED WAMR_BUILD_TARGET) elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) # Build as X86_64 by default in 64-bit platform set (WAMR_BUILD_TARGET "X86_64") - else () + elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # Build as X86_32 by default in 32-bit platform set (WAMR_BUILD_TARGET "X86_32") + else () + message(SEND_ERROR "Unsupported build target platform!") endif () endif () diff --git a/samples/wasm-c-api/CMakeLists.txt b/samples/wasm-c-api/CMakeLists.txt index c395b627a..38838e698 100644 --- a/samples/wasm-c-api/CMakeLists.txt +++ b/samples/wasm-c-api/CMakeLists.txt @@ -39,9 +39,11 @@ if (NOT DEFINED WAMR_BUILD_TARGET) elseif (CMAKE_SIZEOF_VOID_P EQUAL 8) # Build as X86_64 by default in 64-bit platform set (WAMR_BUILD_TARGET "X86_64") - else () + elseif (CMAKE_SIZEOF_VOID_P EQUAL 4) # Build as X86_32 by default in 32-bit platform set (WAMR_BUILD_TARGET "X86_32") + else () + message(SEND_ERROR "Unsupported build target platform!") endif () endif ()