Include API's .lib file in archive

For linking on Windows.
This commit is contained in:
Oliver Hamlet
2016-08-07 20:27:11 +01:00
parent 64f7c6cc57
commit 22d0577415
2 changed files with 21 additions and 6 deletions
+18 -5
View File
@@ -168,15 +168,28 @@ function createAppArchive(rootPath, releasePath, tempPath, destPath) {
fs.removeSync(tempPath);
}
function createApiArchive(rootPath, binaryPath, tempPath, destPath) {
function createApiArchive(rootPath, releasePath, tempPath, destPath) {
// Ensure that the output directory is empty.
fs.emptyDirSync(tempPath);
// API binary/binaries.
fs.copySync(
binaryPath,
path.join(tempPath, path.basename(binaryPath))
);
let binaries = [];
if (os.platform() === 'win32') {
binaries = [
'loot_api.dll',
'loot_api.lib',
];
} else {
binaries = [
'libloot_api.so',
];
}
binaries.forEach((file) => {
fs.copySync(
path.join(releasePath, file),
path.join(tempPath, file)
);
});
// API header file.
fs.mkdirsSync(path.join(tempPath, 'include', 'loot'));
+3 -1
View File
@@ -73,7 +73,9 @@ function getApiBinaryPaths(rootPath) {
file = `lib${file}.so`;
}
return getBinaryPaths(rootPath, file);
return getBinaryParentPaths(rootPath).filter(
parentPath => fileExists(path.join(parentPath.path, file))
);
}
function getMetadataValidatorBinaryPaths(rootPath) {