Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ emcc-loader is configuable on webpack.config.js.
- buildDir : string
-- [Required] absolute path to temporary directory used by emcc.
- cc : string
-- [default=emcc] c compiler path.
-- [default=emcc] c compiler path or command.
- cxx : string
-- [default=em++] c++ compiler path.
-- [default=em++] c++ compiler path or command.
- ld : string
-- [default=emcc] linker path.
-- [default=emcc] linker path or command.
- commonFlags : string[]
-- [default=[]] array of flags passed to all emcc/em++ commands.
- cFlags : string[]
Expand Down
6 changes: 4 additions & 2 deletions src/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ export class Compiler {

await utility.mkdirs(path.dirname(outputPath), undefined);
const { stderr } = await utility
.execute(compiler, [...flags, '-c', '-o', outputPath, srcPath])
.execute(compiler, [...flags, '-c', '-o', outputPath, srcPath], {
shell: true,
})
.catch(err => {
if (err.err.code === 'ENOENT') {
throw new Error(
Expand Down Expand Up @@ -166,7 +168,7 @@ export class Compiler {
}
await utility.mkdirs(path.dirname(outputPath), undefined);
const { stderr } = await utility
.execute(options.ld, flags)
.execute(options.ld, flags, { shell: true })
.catch(err => {
if (err.err.code === 'ENOENT') {
throw new Error(
Expand Down
8 changes: 3 additions & 5 deletions src/utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ export async function getDependencies(
absPath: string,
flags: string[]
) {
const { stdout } = await execute(compiler, [
...flags,
'-MM',
absPath,
]).catch(err => {
const { stdout } = await execute(compiler, [...flags, '-MM', absPath], {
shell: true,
}).catch(err => {
throw err.err;
});
const dependencies = stdout
Expand Down