Skip to content

Commit

Permalink
Trying to solve issues macos.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Feb 24, 2025
1 parent 12c3077 commit d89b966
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
5 changes: 4 additions & 1 deletion source/loaders/node_loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ target_link_libraries(${target}
target_compile_definitions(${target}
PRIVATE
$<$<BOOL:${WIN32}>:NODEJS_LIBRARY_NAME="${NodeJS_LIBRARY_NAME}">
$<$<NOT:$<BOOL:${MSVC}>>:_LARGEFILE_SOURCE>
$<$<NOT:$<BOOL:${MSVC}>>:_FILE_OFFSET_BITS=64>
$<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:_DARWIN_USE_64_BIT_INODE=1>

PUBLIC
$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:${target_upper}_STATIC_DEFINE>
Expand Down Expand Up @@ -199,7 +202,7 @@ target_compile_options(${target}

add_link_options(${target}
PRIVATE
$<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-Wl,-undefined,dynamic_lookup>
$<$<AND:$<BOOL:${APPLE}>,$<CXX_COMPILER_ID:AppleClang,Clang>>:-undefined dynamic_lookup>

PUBLIC
${DEFAULT_LINKER_OPTIONS}
Expand Down
11 changes: 3 additions & 8 deletions source/ports/node_port/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,15 @@ const path = require('path');
const fs = require('fs');
const { URL } = require('url'); /* TODO: RPC Loader */

const findFilesRecursively = (dirPattern, filePattern, depthLimit = Infinity) => {
const stack = [{ dir: dirPattern, depth: 0 }];
const findFilesRecursively = (directory, filePattern, depthLimit = Infinity) => {
const stack = [{ dir: directory, depth: 0 }];
const files = [];
const dirRegex = new RegExp(dirPattern);
const fileRegex = new RegExp(filePattern);

while (stack.length > 0) {
const { dir, depth } = stack.pop();

try {
if (!dirRegex.test(dir)) {
continue;
}

if (depth > depthLimit) {
continue;
}
Expand All @@ -56,7 +51,7 @@ const findFilesRecursively = (dirPattern, filePattern, depthLimit = Infinity) =>
}
}
} catch (err) {
console.error(`Error reading directory ${dir}:`, err);
console.error(`Error reading directory '${dir}' while searching for MetaCall Library:`, err);
}
}

Expand Down

0 comments on commit d89b966

Please sign in to comment.