Skip to content

Commit 6b733b8

Browse files
authored
Automatically detect the host platform in CMakeLists.txt (#929)
Previously, "linux" was hardcoded in the root CMakeLists.txt, so it was impossible to build on anything but Linux, even when specifying WAMR_BUILD_PLATFORM. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
1 parent cdf3063 commit 6b733b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cmake_minimum_required (VERSION 2.8...3.16)
66
project (iwasm)
77
# set (CMAKE_VERBOSE_MAKEFILE 1)
88

9-
set (WAMR_BUILD_PLATFORM "linux")
9+
string (TOLOWER ${CMAKE_HOST_SYSTEM_NAME} WAMR_BUILD_PLATFORM)
1010

1111
# Reset default linker flags
1212
set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")

0 commit comments

Comments
 (0)