Skip to content

Commit

Permalink
Run cmake as part of npm build
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-thompson committed Nov 7, 2023
1 parent 8e8e9f9 commit d89bd12
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
12 changes: 12 additions & 0 deletions native/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,15 @@ target_link_libraries(${TARGET_NAME}
juce::juce_gui_basics
juce::juce_gui_extra
runtime)

install(TARGETS ${TARGET_NAME}_VST3
CONFIGURATIONS Release
COMPONENT plugin
DESTINATION Release)

if(TARGET ${TARGET_NAME}_AU)
install(TARGETS ${TARGET_NAME}_AU
CONFIGURATIONS Release
COMPONENT plugin
DESTINATION Release)
endif()
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"clean": "rimraf dist",
"copy": "cpy manifest.json dist/",
"prebuild": "npm run clean",
"postbuild": "npm run copy",
"dev": "vite",
"build-native": "zx scripts/build-native.mjs",
"build-dsp": "esbuild dsp/main.js --bundle --outdir=dist",
"build-ui": "vite build",
"build": "npm run build-ui && npm run build-dsp",
"build": "npm run build-ui && npm run build-dsp && npm run copy && npm run build-native",
"preview": "vite preview"
},
"dependencies": {
Expand Down
18 changes: 18 additions & 0 deletions scripts/build-native.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env zx


let rootDir = await path.resolve(__dirname, '..');
let buildDir = await path.resolve(rootDir, 'native/build/scripted');
let outDir = await path.resolve(rootDir, 'native/build/out');

echo(`Root directory: ${rootDir}`);
echo(`Build directory: ${buildDir}`);

await fs.ensureDir(buildDir);
await fs.ensureDir(outDir);

cd(buildDir);

await $`cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${outDir} -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 ../..`;
await $`cmake --build . --config Release -j 4`;
await $`cmake --install . --component plugin`;

0 comments on commit d89bd12

Please sign in to comment.