Skip to content

Commit 406136f

Browse files
committed
chore: add nix.gni fallback for non-Nix builds and fix compiler warnings
CMakeLists.txt previously required a nix.gni file (generated by the Nix shell hook) containing platform-specific GN args. Builds outside Nix failed with "file STRINGS file nix.gni cannot be read". Now falls back to sensible defaults (is_clang=true, use_lld=false, clang_use_chrome_plugins=false) when the file doesn't exist. Also add a default UknownError path for ErrorFactory::DOMExceptionNameToString
1 parent a02f94b commit 406136f

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,18 @@ set_target_properties(libc++abi PROPERTIES IMPORTED_OBJECTS_DEBUG "${libc++abi_o
185185
# M114: branch-heads/5735
186186
set(WEBRTC_REVISION branch-heads/5735)
187187

188-
file(STRINGS nix.gni NIX_GN_GEN_ARGS)
188+
# nix.gni is generated by the Nix shell hook (shell.nix) with platform-specific
189+
# GN args like clang_base_path and mac_sdk_path. For non-Nix builds, create an
190+
# empty file or one with: is_clang=true\nuse_lld=false\nclang_use_chrome_plugins=false
191+
if(EXISTS "${CMAKE_SOURCE_DIR}/nix.gni")
192+
file(STRINGS nix.gni NIX_GN_GEN_ARGS)
193+
else()
194+
set(NIX_GN_GEN_ARGS
195+
"is_clang=true"
196+
"use_lld=false"
197+
"clang_use_chrome_plugins=false"
198+
)
199+
endif()
189200
list(APPEND GN_GEN_ARGS
190201
rtc_build_examples=false
191202
rtc_use_x11=false

src/node/error_factory.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ node_webrtc::ErrorFactory::DOMExceptionNameToString(DOMExceptionName name) {
9494
return "NetworkError";
9595
case kOperationError:
9696
return "OperationError";
97+
default:
98+
return "UnknownError";
9799
}
98100
}
99101

0 commit comments

Comments
 (0)