-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Windows support and update the docs installation guide
On Windows, run a postinstall script that will copy the SDL2.dll dynamic library from the devel source to the build directory. This is required so that running the native addon will successfully find the dynamic library. Update docs to reflect that SDL is now hosted on github, and to clarify the steps to install the native addon.
- Loading branch information
Showing
4 changed files
with
45 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const locateSDL = require('./locate_sdl.js'); | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
|
||
function copyDynamicLibToBuild(sdlpath) { | ||
let basename = path.basename(sdlpath); | ||
let dest = path.join(__dirname, '../build/Release/', basename); | ||
console.log(`post-install script for Windows only: copying dynamic library from "${sdlpath}" to "${dest}"`); | ||
fs.copyFileSync(sdlpath, dest); | ||
} | ||
|
||
|
||
if (require.main === module) { | ||
if (process.platform != 'win32') { | ||
return; | ||
} | ||
copyDynamicLibToBuild(locateSDL.locateSDL('dll')); | ||
} |