Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Now We can Use Header File . #365

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

iFlameing
Copy link
Contributor

Associated Issue: #298

Here's the contributing guide at https://github.com/wasdk/WebAssemblyStudio/wiki/Contributing

Summary of Changes

  • change 1
    I changes the service.ts, compilerservice.ts and clangservice.ts according to need.
  • change 2
    I made some modification in build.ts and in the template also for simple implementation of the header file.

Test Plan

Due to some change in the service.ts and specially in clangservice.ts some testcase fail.
But I check the implementation of header file by manually checking .

Example test plan:

  • Create C "hello, world" project
  • Click Build button
  • Click Run button, and observe the Result panel
  • Clicking the "x" on the Result panel closes it

Screenshots/Videos (OPTIONAL)

screenshot from 2018-09-04 21-27-42

screenshot from 2018-09-04 21-27-33

@AnshulMalik
Copy link
Contributor

This looks really good, I'll review in a moment.

@yw662
Copy link

yw662 commented Sep 22, 2018

So can we also compile multiple c/cpp files if this is merged ?

@AnshulMalik
Copy link
Contributor

@iFlameing after looking into it, it seems like we are just handling a specific case of a single header file. Its a great start, I was hoping if we can come up with some more generic solution for this, so that we can compile as many header files as we want.

@iFlameing
Copy link
Contributor Author

@AnshulMalik The main problem regarding the multiple file is that, we have to mention the file name into the build.ts file manually.

@AnshulMalik
Copy link
Contributor

Can we extract all the includes somehow from the one source file we are compiling.
And the automatically add those to the list of files to be compiled?

@iFlameing
Copy link
Contributor Author

@AnshulMalik This might be possible but for compiling we have to send all the file to server and if we include single file in main.c and import other file into header.h then we also have to send all the file which we are importing into the header.h .

@AnshulMalik
Copy link
Contributor

So it's recursive then, don't you love recursion? :P

@iFlameing
Copy link
Contributor Author

iFlameing commented Oct 16, 2018

Now it is supporting multiple header file . @AnshulMalik What you say.

templates/hello_world_c/build.ts Show resolved Hide resolved
src/service.ts Show resolved Hide resolved
src/service.ts Show resolved Hide resolved
src/compilerServices/types.ts Show resolved Hide resolved
src/compilerServices/clangService.ts Show resolved Hide resolved
src/compilerServices/clangService.ts Show resolved Hide resolved
@iFlameing
Copy link
Contributor Author

@yurydelendik I made the change from service.compilefile to service.compilefiles it outputting the file "main.wasm" but when I run it , It giving me [error]: "CompileError: wasm validation error: at offset 4: failed to match magic number".
can you explain what is this error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants