From e48846e074c72a9f21639c57408188092b055583 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 7 Apr 2024 15:28:58 +0300 Subject: [PATCH 01/36] add CI build config --- .github/workflows/build.yml | 81 ++++++++++++++++++++++++++++++++++++ .vscode/settings.json | 3 +- cmake/project-defaults.cmake | 2 - generate_build | 17 ++++++++ yoga/CMakeLists.txt | 7 +++- 5 files changed, 105 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 generate_build diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..8616d0e535 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,81 @@ +name: Build Binaries + +on: [push, pull_request] + +jobs: + build: + name: Build ${{ matrix.os }} + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + strategy: + fail-fast: false + matrix: + os: [macOS-latest, ubuntu-latest, windows-latest] + + steps: + - uses: actions/checkout@v3 + + - name: Setup + uses: ./.github/actions/setup-cpp + with: + toolchain: ${{ startsWith(matrix.os, 'windows') && 'MSVC' || 'Clang' }} + + - name: Build + run: ./generate_build + + - name: Move Windows files + if: startsWith(matrix.os, 'windows') + run: | + mkdir -p dist/win-x64 + cp build/Release/yogacore.dll dist/win-x64/yoga.dll + + - name: Build (x86) + if: startsWith(matrix.os, 'windows') + run: ./generate_build -A Win32 + + - name: Move Windows files (x86) + if: startsWith(matrix.os, 'windows') + run: | + mkdir -p dist/win-x86 + cp build/Release/yogacore.dll dist/win-x86/yoga.dll + + - name: Move MacOS files + if: startsWith(matrix.os, 'macOS') + run: | + mkdir -p dist/osx + cp build/Release/libyogacore.dylib dist/osx/libyoga.dylib + + - name: Move Ubuntu files + if: startsWith(matrix.os, 'ubuntu') + run: | + mkdir -p dist/linux + cp build/Release/libyogacore.so dist/linux/libyoga.so + + - name: Upload Binaries + uses: actions/upload-artifact@v3 + if: github.event_name == 'push' + with: + path: dist/** + name: prebuilt_yoga_binaries + + build-android: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/setup-android + + - name: Build + run: | + ./gradlew :yoga:assembleRelease + mkdir -p dist/android + cp java/build/outputs/aar/yoga-release.aar dist/android/yoga.aar + + - name: Upload Binaries + uses: actions/upload-artifact@v3 + if: github.event_name == 'push' + with: + path: dist/** + name: prebuilt_yoga_binaries + diff --git a/.vscode/settings.json b/.vscode/settings.json index 9339156445..ce4cacff77 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,9 @@ { "editor.formatOnSave": true, "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" }, "eslint.format.enable": true, - "eslint.packageManager": "yarn", "eslint.enable": true, "eslint.validate": [ "javascript", diff --git a/cmake/project-defaults.cmake b/cmake/project-defaults.cmake index 987529c549..e65ff3aa66 100644 --- a/cmake/project-defaults.cmake +++ b/cmake/project-defaults.cmake @@ -18,7 +18,6 @@ add_compile_options( /EHsc # Enable warnings and warnings as errors /W4 - /WX # Disable RTTI $<$:/GR-> # Use /O2 (Maximize Speed) @@ -33,7 +32,6 @@ add_compile_options( -fexceptions # Enable warnings and warnings as errors -Wall - -Werror # Disable RTTI $<$:-fno-rtti> # Use -O2 (prioritize speed) diff --git a/generate_build b/generate_build new file mode 100644 index 0000000000..75ef48efaa --- /dev/null +++ b/generate_build @@ -0,0 +1,17 @@ +#!/bin/sh +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +rm -rf build + +if which ninja; then + set -e + cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja "$@" +else + set -e + cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON "$@" +fi + +cmake --build build --config Release diff --git a/yoga/CMakeLists.txt b/yoga/CMakeLists.txt index b6eca1ac72..8670095c17 100644 --- a/yoga/CMakeLists.txt +++ b/yoga/CMakeLists.txt @@ -3,6 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +option(BUILD_SHARED_LIBS "Build shared libraries (DLLs) instead of static libraries" OFF) cmake_minimum_required(VERSION 3.13...3.26) project(yogacore) @@ -22,7 +23,11 @@ file(GLOB SOURCES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/**/*.cpp) -add_library(yogacore STATIC ${SOURCES}) +if(BUILD_SHARED_LIBS) + add_library(yogacore SHARED ${SOURCES}) +else() + add_library(yogacore STATIC ${SOURCES}) +endif() # Yoga conditionally uses when building for Android if (ANDROID) From 03fcfe595af8ee473fad40b582ac26afe38362b1 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 7 Apr 2024 15:35:41 +0300 Subject: [PATCH 02/36] adding execute permissions --- generate_build | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 generate_build diff --git a/generate_build b/generate_build old mode 100644 new mode 100755 From ad8f308932d8a81a15bd57210093501b4c4f00da Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 7 Apr 2024 15:40:32 +0300 Subject: [PATCH 03/36] temporarily change copy command --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8616d0e535..434391a32a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: if: startsWith(matrix.os, 'windows') run: | mkdir -p dist/win-x64 - cp build/Release/yogacore.dll dist/win-x64/yoga.dll + cp -a build/ dist/win-x64/ - name: Build (x86) if: startsWith(matrix.os, 'windows') @@ -39,19 +39,19 @@ jobs: if: startsWith(matrix.os, 'windows') run: | mkdir -p dist/win-x86 - cp build/Release/yogacore.dll dist/win-x86/yoga.dll + cp -a build/ dist/win-x86/ - name: Move MacOS files if: startsWith(matrix.os, 'macOS') run: | mkdir -p dist/osx - cp build/Release/libyogacore.dylib dist/osx/libyoga.dylib + cp -a build/ dist/osx/ - name: Move Ubuntu files if: startsWith(matrix.os, 'ubuntu') run: | mkdir -p dist/linux - cp build/Release/libyogacore.so dist/linux/libyoga.so + cp -a build/ dist/linux/ - name: Upload Binaries uses: actions/upload-artifact@v3 From b535c4dff14d862c98590b041ce4dd00a6f3dd36 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 7 Apr 2024 15:47:50 +0300 Subject: [PATCH 04/36] add fallback when ninja fails --- generate_build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generate_build b/generate_build index 75ef48efaa..893a81bb45 100755 --- a/generate_build +++ b/generate_build @@ -8,7 +8,8 @@ rm -rf build if which ninja; then set -e - cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja "$@" + cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja "$@" \ + || cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON "$@" else set -e cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON "$@" From b4f237412597fab96562a90746fa8bd0a1c763dc Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 7 Apr 2024 16:00:29 +0300 Subject: [PATCH 05/36] add fallback for ninja and win32 --- generate_build | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/generate_build b/generate_build index 893a81bb45..b012b7012e 100755 --- a/generate_build +++ b/generate_build @@ -6,13 +6,19 @@ rm -rf build -if which ninja; then + +if [ "$#" -eq 0 ]; then + build_cmd="" +else + build_cmd="$@" +fi + +if [[ $build_cmd != *"-A Win32"* && -x $(command -v ninja) ]]; then set -e - cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja "$@" \ - || cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON "$@" + cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja "$build_cmd" else set -e - cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON "$@" + cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON "$build_cmd" fi cmake --build build --config Release From d87cbb91186a582ece06d413490a4f23b0015fce Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 7 Apr 2024 16:10:10 +0300 Subject: [PATCH 06/36] add apple setup --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 434391a32a..e810270476 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,10 @@ jobs: with: toolchain: ${{ startsWith(matrix.os, 'windows') && 'MSVC' || 'Clang' }} + - name: Setup Apple + if: startsWith(matrix.os, 'macOS') + uses: ./.github/actions/setup-apple + - name: Build run: ./generate_build From 93d4b0234b4f2f1a8302532c01841948483ac5d2 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 7 Apr 2024 16:12:39 +0300 Subject: [PATCH 07/36] make macos build on macos-13 --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e810270476..2f7162ce38 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macOS-latest, ubuntu-latest, windows-latest] + os: [macos-13, ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v3 @@ -23,7 +23,7 @@ jobs: toolchain: ${{ startsWith(matrix.os, 'windows') && 'MSVC' || 'Clang' }} - name: Setup Apple - if: startsWith(matrix.os, 'macOS') + if: startsWith(matrix.os, 'macos') uses: ./.github/actions/setup-apple - name: Build @@ -46,7 +46,7 @@ jobs: cp -a build/ dist/win-x86/ - name: Move MacOS files - if: startsWith(matrix.os, 'macOS') + if: startsWith(matrix.os, 'macos') run: | mkdir -p dist/osx cp -a build/ dist/osx/ From cd5f4f660cbdb448cec0ceff310420191cd9f2ff Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 7 Apr 2024 16:17:58 +0300 Subject: [PATCH 08/36] fix build file paths --- .github/workflows/build.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f7162ce38..0280a62a24 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,6 +33,7 @@ jobs: if: startsWith(matrix.os, 'windows') run: | mkdir -p dist/win-x64 + cp build/yogacore.dll dist/win-x64/yoga.dll cp -a build/ dist/win-x64/ - name: Build (x86) @@ -43,19 +44,19 @@ jobs: if: startsWith(matrix.os, 'windows') run: | mkdir -p dist/win-x86 - cp -a build/ dist/win-x86/ + cp build/Release/yogacore.dll dist/win-x86/yoga.dll - name: Move MacOS files if: startsWith(matrix.os, 'macos') run: | mkdir -p dist/osx - cp -a build/ dist/osx/ + cp build/libyogacore.dylib dist/osx/libyoga.dylib - name: Move Ubuntu files if: startsWith(matrix.os, 'ubuntu') run: | mkdir -p dist/linux - cp -a build/ dist/linux/ + cp build/libyogacore.so dist/linux/libyoga.so - name: Upload Binaries uses: actions/upload-artifact@v3 From 4181c519bef49bbc848e0cdcb8d80e8232fdd95c Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 7 Apr 2024 16:22:08 +0300 Subject: [PATCH 09/36] remove build dir copy --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0280a62a24..7663b1508b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,6 @@ jobs: run: | mkdir -p dist/win-x64 cp build/yogacore.dll dist/win-x64/yoga.dll - cp -a build/ dist/win-x64/ - name: Build (x86) if: startsWith(matrix.os, 'windows') From da1b6053e4fa401d69e23205c8aaca5f3d60097d Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 7 Apr 2024 20:53:12 +0300 Subject: [PATCH 10/36] fix for windows --- yoga/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yoga/CMakeLists.txt b/yoga/CMakeLists.txt index 8670095c17..52f9ee811a 100644 --- a/yoga/CMakeLists.txt +++ b/yoga/CMakeLists.txt @@ -24,7 +24,11 @@ file(GLOB SOURCES CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/**/*.cpp) if(BUILD_SHARED_LIBS) - add_library(yogacore SHARED ${SOURCES}) + if(WIN32) + add_library(yogacore MODULE ${SOURCES}) + else() + add_library(yogacore SHARED ${SOURCES}) + endif() else() add_library(yogacore STATIC ${SOURCES}) endif() From b1fb78c84c48528a160c8738d73aae85b9c1d252 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Mon, 8 Apr 2024 00:25:57 +0300 Subject: [PATCH 11/36] disable ninja in windows builds --- .github/workflows/build.yml | 33 +++++++++++++++++++-------------- generate_build | 24 ------------------------ 2 files changed, 19 insertions(+), 38 deletions(-) delete mode 100755 generate_build diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7663b1508b..8f138d6a8d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,9 @@ name: Build Binaries -on: [push, pull_request] +on: + - push + - pull_request + - workflow_dispatch jobs: build: @@ -26,27 +29,29 @@ jobs: if: startsWith(matrix.os, 'macos') uses: ./.github/actions/setup-apple - - name: Build - run: ./generate_build - - - name: Move Windows files + - name: Build (Windows) if: startsWith(matrix.os, 'windows') run: | - mkdir -p dist/win-x64 - cp build/yogacore.dll dist/win-x64/yoga.dll + cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON + cmake -B build32 -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -A Win32 + cmake --build build --config Release + cmake --build build32 --config Release - - name: Build (x86) + - name: Move Windows files if: startsWith(matrix.os, 'windows') - run: ./generate_build -A Win32 + run: | + mkdir -p dist/win-x64 dist/win-x86 + cp build/Release/yogacore.dll dist/win-x64/yoga.dll + cp build32/Release/yogacore.dll dist/win-x86/yoga.dll - - name: Move Windows files (x86) - if: startsWith(matrix.os, 'windows') + - name: Build (non-Windows) + if: startsWith(matrix.os, 'windows') != true run: | - mkdir -p dist/win-x86 - cp build/Release/yogacore.dll dist/win-x86/yoga.dll + cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja + cmake --build build --config Release - name: Move MacOS files - if: startsWith(matrix.os, 'macos') + if: startsWith(matrix.os, 'macos') run: | mkdir -p dist/osx cp build/libyogacore.dylib dist/osx/libyoga.dylib diff --git a/generate_build b/generate_build deleted file mode 100755 index b012b7012e..0000000000 --- a/generate_build +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -# Copyright (c) Meta Platforms, Inc. and affiliates. -# -# This source code is licensed under the MIT license found in the -# LICENSE file in the root directory of this source tree. - -rm -rf build - - -if [ "$#" -eq 0 ]; then - build_cmd="" -else - build_cmd="$@" -fi - -if [[ $build_cmd != *"-A Win32"* && -x $(command -v ninja) ]]; then - set -e - cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja "$build_cmd" -else - set -e - cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON "$build_cmd" -fi - -cmake --build build --config Release From d0a71387a1d169a17684f7c998d18c902fb59c0c Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Mon, 8 Apr 2024 00:40:35 +0300 Subject: [PATCH 12/36] separate build steps --- .github/workflows/build.yml | 91 ++++++++++++++++++++++--------------- 1 file changed, 55 insertions(+), 36 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8f138d6a8d..f5e88b0d3e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,62 +5,81 @@ on: - pull_request - workflow_dispatch +defaults: + run: + shell: bash + jobs: - build: - name: Build ${{ matrix.os }} - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - os: [macos-13, ubuntu-latest, windows-latest] + build-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup + uses: ./.github/actions/setup-cpp + with: + toolchain: Clang + + - name: Build + run: | + cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja + cmake --build build --config Release + mkdir -p dist/linux + cp build/libyogacore.so dist/linux/libyoga.so + - name: Upload Binaries + uses: actions/upload-artifact@v3 + if: github.event_name == 'push' + with: + path: dist/** + name: prebuilt_yoga_binaries + + build-macos: + runs-on: macos-13 steps: - uses: actions/checkout@v3 - name: Setup uses: ./.github/actions/setup-cpp with: - toolchain: ${{ startsWith(matrix.os, 'windows') && 'MSVC' || 'Clang' }} + toolchain: CLang - name: Setup Apple - if: startsWith(matrix.os, 'macos') uses: ./.github/actions/setup-apple - - name: Build (Windows) - if: startsWith(matrix.os, 'windows') + - name: Build run: | cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON - cmake -B build32 -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -A Win32 cmake --build build --config Release - cmake --build build32 --config Release + mkdir -p dist/osx + cp build/libyogacore.dylib dist/osx/libyoga.dylib - - name: Move Windows files - if: startsWith(matrix.os, 'windows') - run: | - mkdir -p dist/win-x64 dist/win-x86 - cp build/Release/yogacore.dll dist/win-x64/yoga.dll - cp build32/Release/yogacore.dll dist/win-x86/yoga.dll + - name: Upload Binaries + uses: actions/upload-artifact@v3 + if: github.event_name == 'push' + with: + path: dist/** + name: prebuilt_yoga_binaries - - name: Build (non-Windows) - if: startsWith(matrix.os, 'windows') != true - run: | - cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja - cmake --build build --config Release + build-windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 - - name: Move MacOS files - if: startsWith(matrix.os, 'macos') - run: | - mkdir -p dist/osx - cp build/libyogacore.dylib dist/osx/libyoga.dylib + - name: Setup + uses: ./.github/actions/setup-cpp + with: + toolchain: MSVC - - name: Move Ubuntu files - if: startsWith(matrix.os, 'ubuntu') + - name: Build run: | - mkdir -p dist/linux - cp build/libyogacore.so dist/linux/libyoga.so + cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON + cmake -B build32 -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -A Win32 + cmake --build build --config Release + cmake --build build32 --config Release + mkdir -p dist/win-x64 dist/win-x86 + cp build/Release/yogacore.dll dist/win-x64/yoga.dll + cp build32/Release/yogacore.dll dist/win-x86/yoga.dll - name: Upload Binaries uses: actions/upload-artifact@v3 From 5c499204686e73672b41227009f45161993a938d Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Mon, 8 Apr 2024 13:32:58 +0300 Subject: [PATCH 13/36] add js build script --- .github/workflows/build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f5e88b0d3e..a0c98ac20d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,9 @@ jobs: with: toolchain: Clang + - name: Setup JS + uses: ./.github/actions/setup-js + - name: Build run: | cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja @@ -27,6 +30,12 @@ jobs: mkdir -p dist/linux cp build/libyogacore.so dist/linux/libyoga.so + rm -rf build + cmake -B build -S javascript -D CMAKE_BUILD_TYPE=Release -G Ninja + cmake --build build --config Release + mkdir -p dist/webgl + cp -a build/ dist/webgl/ + - name: Upload Binaries uses: actions/upload-artifact@v3 if: github.event_name == 'push' From 2f32dfbdfad674e4c665c44d0e9b627533fe758f Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Mon, 8 Apr 2024 13:36:27 +0300 Subject: [PATCH 14/36] remove strict=1 parameter --- javascript/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/javascript/CMakeLists.txt b/javascript/CMakeLists.txt index b1a1278fcd..d337ecff5e 100644 --- a/javascript/CMakeLists.txt +++ b/javascript/CMakeLists.txt @@ -24,8 +24,7 @@ set(COMPILE_OPTIONS -fno-exceptions -fno-rtti -g0 - -Os - "SHELL:-s STRICT=1") + -Os) add_compile_options(${COMPILE_OPTIONS}) From 103e7677800e4cdab57250f65fe236c31e1a4335 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Mon, 8 Apr 2024 13:41:04 +0300 Subject: [PATCH 15/36] add emsdk cache --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0c98ac20d..5c7fd2fe43 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,9 @@ jobs: - name: Setup JS uses: ./.github/actions/setup-js + - name: Restore emsdk + uses: ./.github/actions/cache-emsdk + - name: Build run: | cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -G Ninja From aa455c9815d82a4eef777e3bc2765e4066f40bc1 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Mon, 8 Apr 2024 13:50:32 +0300 Subject: [PATCH 16/36] add emcmake --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c7fd2fe43..93e960af63 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,7 +34,7 @@ jobs: cp build/libyogacore.so dist/linux/libyoga.so rm -rf build - cmake -B build -S javascript -D CMAKE_BUILD_TYPE=Release -G Ninja + emcmake cmake -B build -S javascript -D CMAKE_BUILD_TYPE=Release -G Ninja cmake --build build --config Release mkdir -p dist/webgl cp -a build/ dist/webgl/ From 44b334963be0d92b802891d543db4080fa32a73c Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Mon, 8 Apr 2024 13:55:27 +0300 Subject: [PATCH 17/36] add emsdk activation --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93e960af63..b2647f1bc7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,6 +34,8 @@ jobs: cp build/libyogacore.so dist/linux/libyoga.so rm -rf build + ./javascript/.emsdk/emsdk install latest + ./javascript/.emsdk/emsdk activate latest emcmake cmake -B build -S javascript -D CMAKE_BUILD_TYPE=Release -G Ninja cmake --build build --config Release mkdir -p dist/webgl From 37f5322d9673bf69fec313ee51223b1cedacedd8 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Mon, 8 Apr 2024 13:58:11 +0300 Subject: [PATCH 18/36] add yarn install --- .github/workflows/build.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b2647f1bc7..c59ed521f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,12 +34,11 @@ jobs: cp build/libyogacore.so dist/linux/libyoga.so rm -rf build - ./javascript/.emsdk/emsdk install latest - ./javascript/.emsdk/emsdk activate latest - emcmake cmake -B build -S javascript -D CMAKE_BUILD_TYPE=Release -G Ninja - cmake --build build --config Release + cd javascript + yarn build + cd .. mkdir -p dist/webgl - cp -a build/ dist/webgl/ + cp -a javascript/build/ dist/webgl/ - name: Upload Binaries uses: actions/upload-artifact@v3 From 986684801db0e69d85fbb4a3233ef8846966cf87 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Mon, 8 Apr 2024 14:08:00 +0300 Subject: [PATCH 19/36] copy binaries --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c59ed521f7..6c8759590c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,12 +33,12 @@ jobs: mkdir -p dist/linux cp build/libyogacore.so dist/linux/libyoga.so - rm -rf build - cd javascript + - name: Build JS + working-directory: javascript + run: | yarn build - cd .. - mkdir -p dist/webgl - cp -a javascript/build/ dist/webgl/ + mkdir -p ../dist/webgl + cp -a binaries/ ../dist/webgl/ - name: Upload Binaries uses: actions/upload-artifact@v3 From 7779635e4a2a9fce4b9c206b7333585fcffd96a2 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Mon, 8 Apr 2024 20:41:06 +0300 Subject: [PATCH 20/36] build JS as static lib --- .github/workflows/build.yml | 1 + javascript/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c8759590c..dbf49c60a0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,6 +38,7 @@ jobs: run: | yarn build mkdir -p ../dist/webgl + cp -a build/ ../dist/webgl/ cp -a binaries/ ../dist/webgl/ - name: Upload Binaries diff --git a/javascript/CMakeLists.txt b/javascript/CMakeLists.txt index d337ecff5e..bf31496c91 100644 --- a/javascript/CMakeLists.txt +++ b/javascript/CMakeLists.txt @@ -51,7 +51,7 @@ add_link_options( link_libraries(embind) -add_library(yogaObjLib OBJECT ${SOURCES}) +add_library(yogaObjLib STATIC ${SOURCES}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/binaries) From 714470dd91fbb61587637ba6c3a6d004c291c8c7 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Mon, 8 Apr 2024 21:53:24 +0300 Subject: [PATCH 21/36] add ios build --- .github/workflows/build.yml | 11 +++++++++-- javascript/CMakeLists.txt | 8 +++++++- javascript/just.config.cjs | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dbf49c60a0..0f57c8bfe2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,8 +38,7 @@ jobs: run: | yarn build mkdir -p ../dist/webgl - cp -a build/ ../dist/webgl/ - cp -a binaries/ ../dist/webgl/ + cp build/libyogaObjLib.a ../dist/webgl/libyoga.a - name: Upload Binaries uses: actions/upload-artifact@v3 @@ -68,6 +67,14 @@ jobs: mkdir -p dist/osx cp build/libyogacore.dylib dist/osx/libyoga.dylib + - name: Build IOS + run: | + rm -rf build + cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_Swift_COMPILER_FORCED=true -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 + cmake --build build --config Release + mkdir -p dist/iOS + cp -a build/ dist/iOS/ + - name: Upload Binaries uses: actions/upload-artifact@v3 if: github.event_name == 'push' diff --git a/javascript/CMakeLists.txt b/javascript/CMakeLists.txt index bf31496c91..5b11c1ef79 100644 --- a/javascript/CMakeLists.txt +++ b/javascript/CMakeLists.txt @@ -3,6 +3,8 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +option(BUILD_STATIC_LIBS "Build static library (.a) instead of object library" OFF) + cmake_minimum_required(VERSION 3.13...3.26) set(CMAKE_VERBOSE_MAKEFILE on) project(yoga) @@ -51,7 +53,11 @@ add_link_options( link_libraries(embind) -add_library(yogaObjLib STATIC ${SOURCES}) +if(BUILD_STATIC_LIBS) + add_library(yogaObjLib STATIC ${SOURCES}) +else() + add_library(yogaObjLib OBJECT ${SOURCES}) +endif() set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/binaries) diff --git a/javascript/just.config.cjs b/javascript/just.config.cjs index db3cd3891a..a4f7ddabe7 100644 --- a/javascript/just.config.cjs +++ b/javascript/just.config.cjs @@ -197,6 +197,7 @@ function emcmakeGenerateTask() { '-B', 'build', ...(process.platform === 'win32' ? [] : ['-G', 'Ninja']), + '-D BUILD_STATIC_LIBS=ON', ]; logger.info(['emcmake', ...args].join(' ')); From 6914ef69ba1e900b45b5be8f5a35f1d811e598e4 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Mon, 8 Apr 2024 22:08:43 +0300 Subject: [PATCH 22/36] fix ios output path --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f57c8bfe2..37cc719d10 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,7 +73,7 @@ jobs: cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_Swift_COMPILER_FORCED=true -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 cmake --build build --config Release mkdir -p dist/iOS - cp -a build/ dist/iOS/ + cp build/Release-iphoneos/libyogacore.a dist/iOS/libyoga.a - name: Upload Binaries uses: actions/upload-artifact@v3 From ae684601a380295f72807839f294f4832ad7e5a0 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Mon, 8 Apr 2024 23:33:07 +0300 Subject: [PATCH 23/36] add macos universal build --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 37cc719d10..d7fdfb9e20 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,7 +62,7 @@ jobs: - name: Build run: | - cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON + cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" cmake --build build --config Release mkdir -p dist/osx cp build/libyogacore.dylib dist/osx/libyoga.dylib From 89b37ba5cf66cec49cf5157dcb78d7b73786bdaf Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Tue, 9 Apr 2024 18:03:37 +0300 Subject: [PATCH 24/36] use gcc in ubuntu --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d7fdfb9e20..b82e1e795a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - name: Setup uses: ./.github/actions/setup-cpp with: - toolchain: Clang + toolchain: GCC - name: Setup JS uses: ./.github/actions/setup-js From 049febdbc88ac6de1ef68cb20fa0a68ce44fbac3 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Mon, 15 Jul 2024 17:12:23 +0300 Subject: [PATCH 25/36] remove private flag --- cmake/project-defaults.cmake | 1 + java/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/cmake/project-defaults.cmake b/cmake/project-defaults.cmake index e65ff3aa66..1117573e89 100644 --- a/cmake/project-defaults.cmake +++ b/cmake/project-defaults.cmake @@ -6,6 +6,7 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_VISIBILITY_PRESET hidden) set(CMAKE_POSITION_INDEPENDENT_CODE ON) +set(CMAKE_VISIBILITY_INLINES_HIDDEN 1) add_compile_definitions($<$:DEBUG>) diff --git a/java/CMakeLists.txt b/java/CMakeLists.txt index d8afd671c2..75c3ba4065 100644 --- a/java/CMakeLists.txt +++ b/java/CMakeLists.txt @@ -6,6 +6,7 @@ cmake_minimum_required(VERSION 3.13...3.26) project(yogajni) set(CMAKE_VERBOSE_MAKEFILE on) +set(BUILD_SHARED_LIBS on) set(YOGA_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/..) include(${YOGA_ROOT}/cmake/project-defaults.cmake) From 7e9fdf43bac64d72096d9e9714b90d22ef359fe8 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 29 Jun 2025 14:49:22 +0300 Subject: [PATCH 26/36] update upload-artifact action --- .github/workflows/build.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b82e1e795a..a36f8385e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,7 +41,7 @@ jobs: cp build/libyogaObjLib.a ../dist/webgl/libyoga.a - name: Upload Binaries - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: github.event_name == 'push' with: path: dist/** @@ -76,7 +76,7 @@ jobs: cp build/Release-iphoneos/libyogacore.a dist/iOS/libyoga.a - name: Upload Binaries - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: github.event_name == 'push' with: path: dist/** @@ -103,7 +103,7 @@ jobs: cp build32/Release/yogacore.dll dist/win-x86/yoga.dll - name: Upload Binaries - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: github.event_name == 'push' with: path: dist/** @@ -122,9 +122,8 @@ jobs: cp java/build/outputs/aar/yoga-release.aar dist/android/yoga.aar - name: Upload Binaries - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: github.event_name == 'push' with: path: dist/** name: prebuilt_yoga_binaries - From 283049ff56a3ebaa1f3bc205cdbc739733f35ad1 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 29 Jun 2025 14:58:50 +0300 Subject: [PATCH 27/36] use macos latest --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a36f8385e7..a6fc7ab21f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,7 @@ jobs: name: prebuilt_yoga_binaries build-macos: - runs-on: macos-13 + runs-on: macos-latest steps: - uses: actions/checkout@v3 From f5282ce534c40b5ee3289977393630e09f1b793e Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 29 Jun 2025 15:05:15 +0300 Subject: [PATCH 28/36] setup apple --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a6fc7ab21f..5f0b847dce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,14 +52,14 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Setup Apple + uses: ./.github/actions/setup-apple + - name: Setup uses: ./.github/actions/setup-cpp with: toolchain: CLang - - name: Setup Apple - uses: ./.github/actions/setup-apple - - name: Build run: | cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" From f3ce10806af4dcd6dde864affbb2498f5a264d73 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 29 Jun 2025 15:08:22 +0300 Subject: [PATCH 29/36] update uploaded artifact names --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5f0b847dce..fb76aea4f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,7 +45,7 @@ jobs: if: github.event_name == 'push' with: path: dist/** - name: prebuilt_yoga_binaries + name: prebuilt_yoga_binaries_linux build-macos: runs-on: macos-latest @@ -80,7 +80,7 @@ jobs: if: github.event_name == 'push' with: path: dist/** - name: prebuilt_yoga_binaries + name: prebuilt_yoga_binaries_macos build-windows: runs-on: windows-latest @@ -107,7 +107,7 @@ jobs: if: github.event_name == 'push' with: path: dist/** - name: prebuilt_yoga_binaries + name: prebuilt_yoga_binaries_windows build-android: runs-on: ubuntu-latest @@ -126,4 +126,4 @@ jobs: if: github.event_name == 'push' with: path: dist/** - name: prebuilt_yoga_binaries + name: prebuilt_yoga_binaries_android From 45986d1f09bd6af27b7f648a95a968b725f14fb9 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 29 Jun 2025 15:12:03 +0300 Subject: [PATCH 30/36] revert macos version --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb76aea4f7..6d9d67cacc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,7 @@ jobs: name: prebuilt_yoga_binaries_linux build-macos: - runs-on: macos-latest + runs-on: macos-13 steps: - uses: actions/checkout@v3 From e6e9edee2f625a4f57351cb8636d7587a657ffc4 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 29 Jun 2025 15:14:29 +0300 Subject: [PATCH 31/36] use clang --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d9d67cacc..2b4509f8bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,10 +55,10 @@ jobs: - name: Setup Apple uses: ./.github/actions/setup-apple - - name: Setup - uses: ./.github/actions/setup-cpp - with: - toolchain: CLang + # - name: Setup + # uses: ./.github/actions/setup-cpp + # with: + # toolchain: CLang - name: Build run: | @@ -90,7 +90,7 @@ jobs: - name: Setup uses: ./.github/actions/setup-cpp with: - toolchain: MSVC + toolchain: Clang - name: Build run: | From bff049ba29368091cb1fe94c267ee9fe87c44def Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 29 Jun 2025 15:20:52 +0300 Subject: [PATCH 32/36] revert msvc --- .github/workflows/build.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2b4509f8bd..cce5bff174 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -55,11 +55,6 @@ jobs: - name: Setup Apple uses: ./.github/actions/setup-apple - # - name: Setup - # uses: ./.github/actions/setup-cpp - # with: - # toolchain: CLang - - name: Build run: | cmake -B build -S yoga -D CMAKE_BUILD_TYPE=Release -D BUILD_SHARED_LIBS=ON -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" @@ -90,7 +85,7 @@ jobs: - name: Setup uses: ./.github/actions/setup-cpp with: - toolchain: Clang + toolchain: MSVC - name: Build run: | From 477f5fb2d150664fc852f71d9b69e9eecb60dd39 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 29 Jun 2025 15:53:47 +0300 Subject: [PATCH 33/36] update bitset constant --- .gitignore | 1 + yoga/config/Config.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7d75c154c7..e238466673 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ node_modules # Xcode ## Build generated build/ +build32/ DerivedData/ ## Various settings diff --git a/yoga/config/Config.h b/yoga/config/Config.h index 7bcffd1484..c095c7a9ef 100644 --- a/yoga/config/Config.h +++ b/yoga/config/Config.h @@ -22,7 +22,8 @@ namespace facebook::yoga { class Config; class Node; -using ExperimentalFeatureSet = std::bitset()>; +constexpr size_t ExperimentalFeatureCount = 1; +using ExperimentalFeatureSet = std::bitset; // Whether moving a node from an old to new config should dirty previously // calculated layout results. From fb8f8a826af9a6a937847d41b95e0aeb674c1348 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 29 Jun 2025 17:00:59 +0300 Subject: [PATCH 34/36] potential fix for build failure --- yoga/config/Config.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yoga/config/Config.h b/yoga/config/Config.h index c095c7a9ef..52b50d5b6f 100644 --- a/yoga/config/Config.h +++ b/yoga/config/Config.h @@ -73,10 +73,11 @@ class YG_EXPORT Config : public ::YGConfig { YGCloneNodeFunc cloneNodeCallback_{nullptr}; YGLogger logger_{}; - bool useWebDefaults_ : 1 = false; + bool useWebDefaults_ = false; uint32_t version_ = 0; - ExperimentalFeatureSet experimentalFeatures_{}; + ExperimentalFeatureSet experimentalFeatures_ = ExperimentalFeatureSet{}; + Errata errata_ = Errata::None; float pointScaleFactor_ = 1.0f; void* context_ = nullptr; From 07eacef5f14dea79a8cda6563e6b0e4c9ac9dd86 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 29 Jun 2025 17:06:52 +0300 Subject: [PATCH 35/36] update according to copilot suggestion --- yoga/config/Config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yoga/config/Config.h b/yoga/config/Config.h index 52b50d5b6f..1c8906c44d 100644 --- a/yoga/config/Config.h +++ b/yoga/config/Config.h @@ -76,7 +76,7 @@ class YG_EXPORT Config : public ::YGConfig { bool useWebDefaults_ = false; uint32_t version_ = 0; - ExperimentalFeatureSet experimentalFeatures_ = ExperimentalFeatureSet{}; + ExperimentalFeatureSet experimentalFeatures_ = ExperimentalFeatureSet(0); Errata errata_ = Errata::None; float pointScaleFactor_ = 1.0f; From 9b64921266adb8b1a790206c8232afe355d82f14 Mon Sep 17 00:00:00 2001 From: Gokhan Kurt Date: Sun, 29 Jun 2025 17:10:20 +0300 Subject: [PATCH 36/36] remove /WX --- cmake/project-defaults.cmake | 1 - yoga/config/Config.h | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/cmake/project-defaults.cmake b/cmake/project-defaults.cmake index 2e319256fd..8392ef61ae 100644 --- a/cmake/project-defaults.cmake +++ b/cmake/project-defaults.cmake @@ -19,7 +19,6 @@ add_compile_options( /EHsc # Enable warnings and warnings as errors /W4 - /WX # Enable RTTI $<$:/GR> # Use /O2 (Maximize Speed) diff --git a/yoga/config/Config.h b/yoga/config/Config.h index 1c8906c44d..bb646736bc 100644 --- a/yoga/config/Config.h +++ b/yoga/config/Config.h @@ -73,10 +73,10 @@ class YG_EXPORT Config : public ::YGConfig { YGCloneNodeFunc cloneNodeCallback_{nullptr}; YGLogger logger_{}; - bool useWebDefaults_ = false; + bool useWebDefaults_ : 1 = false; uint32_t version_ = 0; - ExperimentalFeatureSet experimentalFeatures_ = ExperimentalFeatureSet(0); + ExperimentalFeatureSet experimentalFeatures_{}; Errata errata_ = Errata::None; float pointScaleFactor_ = 1.0f;