diff --git a/Makefile b/Makefile index dbd8562fe3..80aae5f1d1 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ jsc-copy-headers: find src/JavaScript/jsc/WebKit/WebKitBuild/Release/JavaScriptCore/Headers/JavaScriptCore/ -name "*.h" -exec cp {} src/JavaScript/jsc/WebKit/WebKitBuild/Release/JavaScriptCore/PrivateHeaders/JavaScriptCore \; jsc-build-mac-compile: - cd src/javascript/jsc/WebKit && ICU_INCLUDE_DIRS="/usr/local/opt/icu4c/include" ./Tools/Scripts/build-jsc --jsc-only --cmakeargs="-DENABLE_STATIC_JSC=ON -DCMAKE_BUILD_TYPE=relwithdebinfo -DCMAKE_OSX_ARCHITECTURES=arm64;x86_64" && echo "Ignore the \"has no symbols\" errors" + cd src/javascript/jsc/WebKit && ICU_INCLUDE_DIRS="$(brew --prefix)opt/icu4c/include" ./Tools/Scripts/build-jsc --jsc-only --cmakeargs="-DENABLE_STATIC_JSC=ON -DCMAKE_BUILD_TYPE=relwithdebinfo && echo "Ignore the \"has no symbols\" errors" jsc-build-linux-compile: cd src/javascript/jsc/WebKit && ./Tools/Scripts/build-jsc --jsc-only --cmakeargs="-DENABLE_STATIC_JSC=ON -DCMAKE_BUILD_TYPE=relwithdebinfo diff --git a/build.zig b/build.zig index 4514d2cd74..4e1798155b 100644 --- a/build.zig +++ b/build.zig @@ -215,16 +215,20 @@ pub fn build(b: *std.build.Builder) void { // step.single_threaded = single_threaded; - // We must link ICU statically - step.addObjectFile("/usr/local/opt/icu4c/lib/libicudata.a"); - step.addObjectFile("/usr/local/opt/icu4c/lib/libicui18n.a"); - step.addObjectFile("/usr/local/opt/icu4c/lib/libicuuc.a"); - if (target.getOsTag() == .macos) { + const homebrew_prefix = comptime if (std.Target.current.cpu.arch == .aarch64) + "/opt/homebrew/" + else + "/usr/local/"; + + // We must link ICU statically + step.addObjectFile(homebrew_prefix ++ "opt/icu4c/lib/libicudata.a"); + step.addObjectFile(homebrew_prefix ++ "opt/icu4c/lib/libicui18n.a"); + step.addObjectFile(homebrew_prefix ++ "opt/icu4c/lib/libicuuc.a"); // icucore is a weird macOS only library step.linkSystemLibrary("icucore"); - step.addLibPath("/usr/local/opt/icu4c/lib"); - step.addIncludeDir("/usr/local/opt/icu4c/include"); + step.addLibPath(homebrew_prefix ++ "opt/icu4c/lib"); + step.addIncludeDir(homebrew_prefix ++ "opt/icu4c/include"); } for (bindings_files.items) |binding| { diff --git a/examples/hello-create-react-app/src/App.jsx b/examples/hello-create-react-app/src/App.jsx new file mode 100644 index 0000000000..a675d389de --- /dev/null +++ b/examples/hello-create-react-app/src/App.jsx @@ -0,0 +1,25 @@ +import logo from "./logo.svg"; +import * as React from "react"; +import "./App.css"; + +function App() { + const ms = Date.now() - parseInt(window.location.search.substring(1), 10); + return ( +
+
+ logo +

Loaded in {ms}ms.

+ + Learn React + +
+
+ ); +} + +export default App; diff --git a/examples/hello-create-react-app/src/index.jsx b/examples/hello-create-react-app/src/index.jsx new file mode 100644 index 0000000000..26419cdcb6 --- /dev/null +++ b/examples/hello-create-react-app/src/index.jsx @@ -0,0 +1,17 @@ +import * as React from "react"; +import ReactDOM from "react-dom"; +import "./index.css"; +import App from "./App"; +import reportWebVitals from "./reportWebVitals"; + +ReactDOM.render( + + + , + document.getElementById("root") +); + +// If you want to start measuring performance in your app, pass a function +// to log results (for example: reportWebVitals(console.log)) +// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals +reportWebVitals();