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

Document how to build PHP in dev mode (emcc options) #176

Open
adamziel opened this issue Mar 25, 2023 · 1 comment
Open

Document how to build PHP in dev mode (emcc options) #176

adamziel opened this issue Mar 25, 2023 · 1 comment
Labels
[Feature] PHP.wasm [Type] Documentation Improvements or additions to documentation

Comments

@adamziel
Copy link
Collaborator

The emcc needs the following options to build a non-minified output with symbols:

-O0    # don't optimize
-g2     # how much information to retain, use g3 to produce a DWARF file
 -s ASSERTIONS=3     # Add additional assertions to provide more meaningful error messages
@adamziel adamziel added the [Type] Documentation Improvements or additions to documentation label Mar 25, 2023
@adamziel
Copy link
Collaborator Author

Caveat: -s ASSERTIONS=3 adds the following not-so-useful code to the .js file:

assert(!ENVIRONMENT_IS_WEB, "web environment detected but not enabled at build time.  Add 'web' to `-sENVIRONMENT` to enable.");

assert(!ENVIRONMENT_IS_NODE, "node environment detected but not enabled at build time.  Add 'node' to `-sENVIRONMENT` to enable.");

assert(!ENVIRONMENT_IS_SHELL, "shell environment detected but not enabled at build time.  Add 'shell' to `-sENVIRONMENT` to enable.");

It's not very useful because WEB and WORKER are the same in our case, even if Emscripten wants to distinguish between them.

@adamziel adamziel changed the title Document how to build PHP in dev mode options Document how to build PHP in dev mode (emcc options) Apr 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] PHP.wasm [Type] Documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant