@@ -5,19 +5,19 @@ import state, { saveCache } from '../state/index.js';
55import { getFileHash } from '../utils/hash.js' ;
66import run from './run.js' ;
77
8- export default function createBridgeFile ( headerOrModuleFilePath ) {
8+ export default function createBridgeFile ( headerOrModuleFilePath , platform = 'Emscripten-x86_64' ) {
99 const interfaceFilePath = upath . resolve ( headerOrModuleFilePath ) ;
1010 if ( ! fs . existsSync ( `${ state . config . paths . build } /interface` ) ) {
1111 fs . mkdirSync ( `${ state . config . paths . build } /interface` , { recursive : true } ) ;
1212 }
1313 if ( ! fs . existsSync ( `${ state . config . paths . build } /bridge` ) ) {
1414 fs . mkdirSync ( `${ state . config . paths . build } /bridge` , { recursive : true } ) ;
1515 }
16- const interfaceFile = createInterfaceFile ( interfaceFilePath ) ;
17- return createBridgeFileFromInterfaceFile ( interfaceFile ) ;
16+ const interfaceFile = createInterfaceFile ( interfaceFilePath , platform ) ;
17+ return createBridgeFileFromInterfaceFile ( interfaceFile , platform ) ;
1818}
1919
20- function createInterfaceFile ( headerOrModuleFilePath ) {
20+ function createInterfaceFile ( headerOrModuleFilePath , platform ) {
2121 if ( ! headerOrModuleFilePath ) {
2222 return null ;
2323 }
@@ -37,7 +37,7 @@ function createInterfaceFile(headerOrModuleFilePath) {
3737 return newPath ;
3838 }
3939
40- const headerPaths = ( state . config . dependencyParameters ?. pathsOfCmakeDepends ?. split ( ';' ) || [ ] )
40+ const headerPaths = ( state . config . dependencyParameters ?. getCmakeDependsPathAndName ( platform ) . pathsOfCmakeDepends || [ ] )
4141 . filter ( ( d ) => d . startsWith ( state . config . paths . base ) ) ;
4242
4343 const temp2 = headerPaths
@@ -92,7 +92,7 @@ function createInterfaceFile(headerOrModuleFilePath) {
9292 return outputFilePath ;
9393}
9494
95- function createBridgeFileFromInterfaceFile ( interfaceFilePath ) {
95+ function createBridgeFileFromInterfaceFile ( interfaceFilePath , platform ) {
9696 if ( ! interfaceFilePath ) {
9797 return null ;
9898 }
@@ -105,8 +105,8 @@ function createBridgeFileFromInterfaceFile(interfaceFilePath) {
105105 const allHeaders = state . config . dependencyParameters . headerPathWithDepends . split ( ';' ) ;
106106
107107 let includePath = [
108- ...state . config . allDependencies . map ( ( d ) => `${ d . paths . output } /prebuilt/Emscripten-x86_64 /include` ) ,
109- ...state . config . allDependencies . map ( ( d ) => `${ d . paths . output } /prebuilt/Emscripten-x86_64 /swig` ) ,
108+ ...state . config . allDependencies . map ( ( d ) => `${ d . paths . output } /prebuilt/${ platform } /include` ) ,
109+ ...state . config . allDependencies . map ( ( d ) => `${ d . paths . output } /prebuilt/${ platform } /swig` ) ,
110110 ...state . config . paths . header ,
111111 ...allHeaders ,
112112 ] . filter ( ( path ) => ! ! path . toString ( ) ) . map ( ( path ) => `-I${ path } ` ) ;
0 commit comments