File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Copyright (C) 2025 Midokura Japan KK. All rights reserved.
2+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+ cmake_minimum_required (VERSION 3.16 )
5+
6+ project (printversion LANGUAGES C )
7+
8+ add_executable (printversion printversion.c )
9+ find_package (iwasm REQUIRED )
10+ target_link_libraries (printversion iwasm::vmlib )
Original file line number Diff line number Diff line change 1+ /*
2+ * Copyright (C) 2023 Midokura Japan KK. All rights reserved.
3+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+ */
5+
6+ #include <inttypes.h>
7+ #include <stdint.h>
8+ #include <stdio.h>
9+
10+ #include <wasm_export.h>
11+
12+ int
13+ main (int argc , char * * argv )
14+ {
15+ uint32_t major ;
16+ uint32_t minor ;
17+ uint32_t patch ;
18+ wasm_runtime_get_version (& major , & minor , & patch );
19+ printf ("wasm-micro-runtime %" PRIu32 ".%" PRIu32 ".%" PRIu32 "\n" , major ,
20+ minor , patch );
21+ }
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # Copyright (C) 2025 Midokura Japan KK. All rights reserved.
4+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
6+ set -e
7+
8+ DIST=$( mktemp -d)
9+
10+ # WAMR_BUILD_SIMD=0 to avoid fetching simde, which is
11+ # not relevant to this particular test.
12+ cmake -B build-wamr \
13+ -D CMAKE_INSTALL_PREFIX=${DIST} \
14+ -D WAMR_BUILD_SIMD=0 \
15+ ../..
16+ cmake --build build-wamr -t install
17+
18+ cmake -B build-app \
19+ -D CMAKE_PREFIX_PATH=${DIST} \
20+ -D CMAKE_INSTALL_PREFIX=${DIST} \
21+ .
22+ cmake --build build-app
23+
24+ ./build-app/printversion
You can’t perform that action at this time.
0 commit comments