-
Notifications
You must be signed in to change notification settings - Fork 2
Refactor build system #15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f63d230
feat: use wasi-sysroot instead of WASI-SDK
casaroli 79e0b52
refactor: separate sysroot
casaroli 6095fe0
chore(gitignore): add sysroot
casaroli 8a0873a
docs: update README
casaroli cbdd120
build: refactor testing containers
casaroli 66948a6
build: ocre-sdk
casaroli 4984bde
build: print WAMR_ROOT location
casaroli e8b4c76
ci: add build
casaroli a65e298
build: use wasi-sdk
casaroli f6477f3
Revert "docs: update README"
casaroli 74ef58c
build(board_specific): fix build
casaroli 15c9963
build: pass WAMR_ROOT to samples
casaroli File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # @copyright Copyright (c) contributors to Project Ocre, | ||
| # which has been established as Project Ocre a Series of LF Projects, LLC | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: Build Samples | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
| workflow_dispatch: | ||
| inputs: | ||
| devcontainer-tag: | ||
| description: "Devcontainer tag" | ||
| required: false | ||
| default: "latest" | ||
| type: string | ||
|
|
||
| concurrency: | ||
| group: ${{ github.repository }}-${{ github.workflow }}@build-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build Samples | ||
| runs-on: "ubuntu-22.04" | ||
| container: | ||
| image: ghcr.io/project-ocre/ocre-runtime/devcontainer-linux:${{ inputs.devcontainer-tag || 'latest'}} | ||
| options: --user 1001:127 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - name: Configure | ||
| run: | | ||
| mkdir build && cd build | ||
| cmake .. | ||
| make | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,8 @@ | ||
| # Build directories | ||
| **/build/ | ||
|
|
||
| sysroot/ | ||
|
|
||
| # VSCode | ||
| .vscode/* | ||
| *.code-workspace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,95 +1,149 @@ | ||
| cmake_minimum_required (VERSION 3.20.0) | ||
|
|
||
| # Set the WASI SDK toolchain file | ||
| set(CMAKE_TOOLCHAIN_FILE /opt/wasi-sdk/share/cmake/wasi-sdk-pthread.cmake) | ||
| project(ocre-sdk) | ||
|
|
||
| set(CMAKE_VERBOSE_MAKEFILE TRUE) | ||
|
|
||
| project(OcreSdkSamples) | ||
| include(ExternalProject) | ||
|
|
||
| # Set the linker flags | ||
| set(CMAKE_EXE_LINKER_FLAGS "-Wl,--strip-all -Wl,--allow-undefined -Wl,--max-memory=1048576") | ||
| make_directory(${CMAKE_CURRENT_BINARY_DIR}/dist) | ||
|
|
||
| # Set compilation flags | ||
| add_compile_options( | ||
| -O0 -Wno-unknown-attributes | ||
| -O3 | ||
| -Wall | ||
| -Wextra | ||
| -Wno-unused-parameter | ||
| ExternalProject_Add(big-sample | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/big-sample | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp big-sample.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| if(NOT WAMR_ROOT_DIR) | ||
| set(WAMR_ROOT_DIR "wasm-micro-runtime") | ||
| endif() | ||
|
|
||
| include(${WAMR_ROOT_DIR}/core/iwasm/libraries/lib-socket/lib_socket_wasi.cmake) | ||
|
|
||
| add_subdirectory(ocre-sdk) | ||
| ExternalProject_Add(blinky | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/blinky | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp blinky.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| # Create the executable targets | ||
| add_executable("hello-world.wasm" generic/hello-world/main.c) | ||
| ExternalProject_Add(blinky-board-generic | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/blinky-board-generic | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp blinky-board-generic.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| add_executable("blinky.wasm" generic/blinky/main.c) | ||
| ExternalProject_Add(echo-server | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/echo-server | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp echo-server.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| # Include + link the Ocre API and WAMR socket library | ||
| target_include_directories("blinky.wasm" PRIVATE | ||
| ocre_api | ||
| ExternalProject_Add(filesystem | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/filesystem | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp filesystem.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| target_link_libraries("blinky.wasm" ocre_api) | ||
| ExternalProject_Add(filesystem-full | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/filesystem-full | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp filesystem-full.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| add_executable("publisher.wasm" generic/messaging/publisher/main.c) | ||
| ExternalProject_Add(hello-world | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/hello-world | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp hello-world.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| target_include_directories("publisher.wasm" PRIVATE | ||
| ocre_api | ||
| ExternalProject_Add(log_mirror_forwarder | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/log_mirror_forwarder | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp syslog_webserver.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| target_link_libraries("publisher.wasm" ocre_api) | ||
| ExternalProject_Add(publisher | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/messaging/publisher | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp publisher.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| add_executable("subscriber.wasm" generic/messaging/subscriber/main.c) | ||
| ExternalProject_Add(subscriber | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/messaging/subscriber | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp subscriber.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| target_include_directories("subscriber.wasm" PRIVATE | ||
| ocre_api | ||
| ExternalProject_Add(publisher_inside | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/messaging/multipublisher-subscriber/publisher_inside | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp publisher_inside.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| target_link_libraries("subscriber.wasm" ocre_api) | ||
| ExternalProject_Add(publisher_outside | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/messaging/multipublisher-subscriber/publisher_outside | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp publisher_outside.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| add_executable("filesystem.wasm" generic/filesystem/main.c) | ||
| ExternalProject_Add(subscriber_temp | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/messaging/multipublisher-subscriber/subscriber_temp | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp subscriber_temp.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| target_include_directories("filesystem.wasm" PRIVATE | ||
| ocre_api | ||
| ExternalProject_Add(modbus-client | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/modbus-client | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp modbus-client.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| target_link_libraries("filesystem.wasm" ocre_api) | ||
| ExternalProject_Add(shared-filesystem-reader | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/shared-filesystem/shared-filesystem-reader | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp shared-filesystem-reader.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| add_executable("filesystem-full.wasm" generic/filesystem-full/main.c) | ||
| ExternalProject_Add(shared-filesystem-writer | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/shared-filesystem/shared-filesystem-writer | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp shared-filesystem-writer.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| target_include_directories("filesystem-full.wasm" PRIVATE | ||
| ocre_api | ||
| ExternalProject_Add(webserver | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/webserver | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp webserver.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| target_link_libraries("filesystem-full.wasm" ocre_api) | ||
| ExternalProject_Add(webserver-complex | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/generic/webserver-complex | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp webserver-complex.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| add_executable("webserver.wasm" generic/webserver/main.c generic/webserver/mongoose.c) | ||
| # Testing | ||
|
|
||
| target_include_directories("webserver.wasm" PRIVATE | ||
| ${WAMR_ROOT_DIR}/core/iwasm/libraries/lib-socket | ||
| ocre_api | ||
| ExternalProject_Add(print_args | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/testing/print_args | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp print_args.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| target_link_libraries("webserver.wasm" socket_wasi_ext ocre_api) | ||
|
|
||
| add_executable("webserver-complex.wasm" generic/webserver-complex/main.c generic/webserver-complex/mongoose.c) | ||
| ExternalProject_Add(pthread | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/testing/pthread | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp pthread.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| target_include_directories("webserver-complex.wasm" PRIVATE | ||
| ${WAMR_ROOT_DIR}/core/iwasm/libraries/lib-socket | ||
| ocre_api | ||
| ExternalProject_Add(return0 | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/testing/return0 | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp return0.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| target_link_libraries("webserver-complex.wasm" socket_wasi_ext ocre_api) | ||
| ExternalProject_Add(return1 | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/testing/return1 | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp return1.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) | ||
|
|
||
| add_executable("return0.wasm" testing/return0.c) | ||
| add_executable("return1.wasm" testing/return1.c) | ||
| add_executable("sleep_5_return_0.wasm" testing/sleep_5_return_0.c) | ||
| add_executable("pthread.wasm" testing/pthread.c) | ||
| ExternalProject_Add(sleep5_return0 | ||
| SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/testing/sleep5_return0 | ||
| CMAKE_ARGS "-DCMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}" "-DWAMR_ROOT:STRING=${WAMR_ROOT}" | ||
| INSTALL_COMMAND cp sleep5_return0.wasm ${CMAKE_CURRENT_BINARY_DIR}/dist | ||
| ) |
27 changes: 9 additions & 18 deletions
27
board_specific/arduino_portenta_h7/blinky-h7/CMakeLists.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,14 @@ | ||
| cmake_minimum_required(VERSION 3.20.0) | ||
| cmake_minimum_required (VERSION 3.20.0) | ||
|
|
||
| # Set the WASI SDK toolchain file | ||
| set(CMAKE_TOOLCHAIN_FILE /opt/wasi-sdk/share/cmake/wasi-sdk.cmake) | ||
| include(${CMAKE_CURRENT_LIST_DIR}/../../../ocre.cmake) | ||
|
|
||
| # Set the project name (needs to come after the toolchain file) | ||
| set(APPNAME blinky-h7) | ||
| project(${APPNAME}) | ||
| project(blinky-h7) | ||
|
|
||
| # Set the linker flags | ||
| set(CMAKE_EXE_LINKER_FLAGS "-Wl,--strip-all -Wl,--allow-undefined") | ||
| add_executable(blinky-h7.wasm main.c) | ||
|
|
||
| # Set compilation flags | ||
| add_compile_options( | ||
| -O0 -Wno-unknown-attributes | ||
| -O3 | ||
| -Wall | ||
| -Wextra | ||
| -Wno-unused-parameter | ||
| ) | ||
| add_subdirectory(../../../ocre-sdk ocre-sdk) | ||
|
|
||
| # Create the executable target | ||
| add_executable(${APPNAME}.wasm main.c) | ||
| target_link_libraries(blinky-h7.wasm | ||
| PUBLIC | ||
| ocre_api | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,14 @@ | ||
| cmake_minimum_required(VERSION 3.20.0) | ||
| set(CMAKE_TOOLCHAIN_FILE /opt/wasi-sdk/share/cmake/wasi-sdk.cmake) | ||
| set(APPNAME blinky-u585) | ||
| project(${APPNAME} LANGUAGES C) | ||
| cmake_minimum_required (VERSION 3.20.0) | ||
|
|
||
| set(CMAKE_EXE_LINKER_FLAGS "-Wl,--strip-all -Wl,--allow-undefined") | ||
| add_compile_options( | ||
| -O3 | ||
| -Wall | ||
| -Wextra | ||
| -Wno-unused-parameter | ||
| -Wno-unknown-attributes | ||
| ) | ||
| include(${CMAKE_CURRENT_LIST_DIR}/../../../ocre.cmake) | ||
|
|
||
| project(blinky-u585) | ||
|
|
||
| # Add the ocre-sdk as a subdirectory and build it | ||
| set(OCRE_SDK_PATH "../../../ocre-sdk") | ||
| if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${OCRE_SDK_PATH}/CMakeLists.txt") | ||
| message(FATAL_ERROR "ocre-sdk not found at ${OCRE_SDK_PATH}. Please ensure the ocre-sdk directory exists and contains CMakeLists.txt") | ||
| endif() | ||
| add_executable(blinky-u585.wasm main.c) | ||
|
|
||
| add_subdirectory(${OCRE_SDK_PATH} ocre-sdk-build) | ||
| add_subdirectory(../../../ocre-sdk ocre-sdk) | ||
|
|
||
| add_executable(${APPNAME}.wasm main.c) | ||
| target_include_directories(${APPNAME}.wasm PRIVATE ocre_api) | ||
| target_link_libraries(${APPNAME}.wasm PRIVATE ocre_api) | ||
| target_link_libraries(blinky-u585.wasm | ||
| PUBLIC | ||
| ocre_api | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,14 @@ | ||
| cmake_minimum_required(VERSION 3.20.0) | ||
| set(CMAKE_TOOLCHAIN_FILE /opt/wasi-sdk/share/cmake/wasi-sdk.cmake) | ||
| set(APPNAME blinky-xmas) | ||
| project(${APPNAME} LANGUAGES C) | ||
| cmake_minimum_required (VERSION 3.20.0) | ||
|
|
||
| set(CMAKE_EXE_LINKER_FLAGS "-Wl,--strip-all -Wl,--allow-undefined") | ||
| add_compile_options( | ||
| -O3 | ||
| -Wall | ||
| -Wextra | ||
| -Wno-unused-parameter | ||
| -Wno-unknown-attributes | ||
| ) | ||
| include(${CMAKE_CURRENT_LIST_DIR}/../../../ocre.cmake) | ||
|
|
||
| project(blinky-xmas) | ||
|
|
||
| # Add the ocre-sdk as a subdirectory and build it | ||
| set(OCRE_SDK_PATH "../../../ocre-sdk") | ||
| if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${OCRE_SDK_PATH}/CMakeLists.txt") | ||
| message(FATAL_ERROR "ocre-sdk not found at ${OCRE_SDK_PATH}. Please ensure the ocre-sdk directory exists and contains CMakeLists.txt") | ||
| endif() | ||
| add_executable(blinky-xmas.wasm main.c) | ||
|
|
||
| add_subdirectory(${OCRE_SDK_PATH} ocre-sdk-build) | ||
| add_subdirectory(../../../ocre-sdk ocre-sdk) | ||
|
|
||
| add_executable(${APPNAME}.wasm main.c) | ||
| target_include_directories(${APPNAME}.wasm PRIVATE ocre_api) | ||
| target_link_libraries(${APPNAME}.wasm PRIVATE ocre_api) | ||
| target_link_libraries(blinky-xmas.wasm | ||
| PUBLIC | ||
| ocre_api | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the latest LTS is 24.04 and is more widely used. Maybe we want to use that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is just docker