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

Add emcc option "--split <size>" to split javascript file. #594

Merged

Conversation

larsxschneider
Copy link
Contributor

Splits the resulting javascript file into pieces to ease debugging.
This option only works if Javascript is generated (target -o .js).

Files with function declarations must be loaded before main file upon execution.

Without "-g" option:
Creates files with function declarations up to the given size with the suffix "_functions.partxxx.js" and a main file with the suffix ".js".

With "-g" option:
Recreates the directory structure of the C source files and stores function declarations in their respective C files with the suffix ".js". If such a file exceeds the given size, files with the suffix ".partxxx.js" are created. The main file resides in the base directory and has the suffix ".js".

Splits the resulting javascript file into pieces to ease debugging.
This option only works if Javascript is generated (target -o <name>.js).

Files with function declarations must be loaded before main file upon execution.

Without "-g" option:
Creates files with function declarations up to the given size with the suffix "_functions.partxxx.js" and a main file with the suffix ".js".

With "-g" option:
Recreates the directory structure of the C source files and stores function declarations in their respective C files with the suffix ".js". If such a file exceeds the given size, files with the suffix ".partxxx.js" are created. The main file resides in the base directory and has the suffix ".js".
output = Popen(['python', EMCC, path_from_root('tests', 'hello_world_sdl.cpp'), '-o', 'something.js', '--split', '100']).communicate()
assert os.path.exists(os.path.join(self.get_dir(), 'something.js')), 'must be side js'
assert os.path.exists(os.path.join(self.get_dir(), 'something_functions.js')), 'must be side js'
assert os.path.exists(os.path.join(self.get_dir(), 'something.include.html')), 'must be side js'
Copy link
Member

Choose a reason for hiding this comment

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

Need a different text at the end of this line I think

@kripken
Copy link
Member

kripken commented Sep 27, 2012

Very nice work! I just have the one minor comment above.

kripken added a commit that referenced this pull request Sep 30, 2012
Add emcc option "--split <size>" to split javascript file.
@kripken kripken merged commit be25346 into emscripten-core:incoming Sep 30, 2012
@kripken
Copy link
Member

kripken commented Sep 30, 2012

Thanks!

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.

None yet

2 participants