fix qt config and compilation

This commit is contained in:
Atul R 2020-02-24 21:34:00 +01:00
parent 2ba2de7da4
commit c74fa1c7f0
2 changed files with 7 additions and 5 deletions

View File

@ -9,7 +9,6 @@ function getMiniQtConfig() {
case 'darwin': {
return {
qtHome: path.resolve(SETUP_DIR, QT_VERSION, 'clang_64'),
version: QT_VERSION,
artifacts: [
{
name: 'Qt Base',
@ -21,7 +20,6 @@ function getMiniQtConfig() {
case 'win32': {
return {
qtHome: path.resolve(SETUP_DIR, QT_VERSION, 'msvc2017_64'),
version: QT_VERSION,
artifacts: [
{
name: 'Qt Base',
@ -33,7 +31,6 @@ function getMiniQtConfig() {
case 'linux': {
return {
qtHome: path.resolve(SETUP_DIR, QT_VERSION, 'gcc_64'),
version: QT_VERSION,
artifacts: [
{
name: 'Qt Base',
@ -49,7 +46,12 @@ function getMiniQtConfig() {
}
}
const miniQt = getMiniQtConfig();
const miniQt = {
...getMiniQtConfig(),
version: QT_VERSION,
setupDir: SETUP_DIR,
};
const useCustomQt = Boolean(process.env.QT_INSTALL_DIR);
const qtHome = useCustomQt ? process.env.QT_INSTALL_DIR : miniQt.qtHome;
const qtCmakeDir = path.resolve(qtHome, 'lib', 'cmake', 'Qt5');

View File

@ -12,7 +12,7 @@
"build": "cross-env tsc && npm run build:addon",
"postinstall": "cross-env npm run setupqt && (node ./scripts/skip.js || npm run prebuild:install || npm run build:addon)",
"setupqt": "node ./scripts/setupMiniQt.js",
"build:addon": "cross-env CMAKE_BUILD_PARALLEL_LEVEL=8 cmake-js build",
"build:addon": "cross-env CMAKE_BUILD_PARALLEL_LEVEL=8 cmake-js compile",
"prebuild:install": "prebuild-install --backend=cmake-js --runtime=napi --verbose",
"test": "qode ./node_modules/jest/bin/jest -i",
"lint:cpp": "clang-format -i --glob=src/cpp/**/*.[h,c]*",