Skip to content
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

feat(dev-cli): added ability to init c/cpp and build it into a custom ao module #828 #829

Merged
merged 10 commits into from
Aug 8, 2024

Conversation

PeterFarber
Copy link
Contributor

@PeterFarber PeterFarber commented Jun 27, 2024

Closes #828

Pull Request: C Language Support, Code Refactor, Starter Projects, and Library Integration

Description

This pull request includes several important updates to enhance the development environment:

  1. C Language Support for WebAssembly (WASM)

    • Added support for building WebAssembly (WASM) modules from C code using the dev-cli.
    • Enables compiling C code into WebAssembly binaries for improved flexibility.
  2. Codebase Refactor

    • Refactored the codebase to improve readability and maintainability.
    • Enhanced modularity to support the addition of more languages.
    • Improved naming conventions and added comprehensive comments.
  3. Starter Projects

    • Introduced new starter projects for initializing C and Lua projects:
      • C Starter Project: Provides a basic setup for C projects targeting WebAssembly.
      • Lua Starter Project: Includes a template for Lua projects with configuration and sample code.
    • Added support for initializing these projects via the ao init command.
  4. Library Integration Support

    • Added functionality to support the inclusion of libraries during the compilation process.
    • Users can now compile a library using emcmake into a .so file and place it in the project directory.
    • The system will recognize and integrate these libraries into the WebAssembly build.

New Workflow: (Backwards compatible old commands still work the same)

ao init  [project_name]          # (Generates a process.lua)
ao init -l c [project_name]    # (Generates a process.cpp, ao.h, and json.hpp)
ao build       # (Calls the updated emcc-lua renamed to ao-build-module to inject the header files and build the cpp files)

Copy link
Contributor

@twilson63 twilson63 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@PeterFarber PeterFarber force-pushed the peterfarber/devcli-c-cpp branch from 531a153 to 8895f1f Compare August 8, 2024 14:52
@PeterFarber PeterFarber merged commit 3ec2373 into main Aug 8, 2024
3 checks passed
@PeterFarber PeterFarber deleted the peterfarber/devcli-c-cpp branch August 8, 2024 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(dev-cli): Add Support Building Modules With C/CPP
2 participants