← 블로그 목록[과제] 1주차) 프로젝트 작업환경 구성 이연석
환경
| 항목 | 값 |
|---|
| OS | MacOS Tahoe 26.4.1 |
| CPU | Apple M2 |
| RAM | 16 GB |
| Shell | zsh |
| Package Manager | Homebrew |
1. 디펜던시 설치 및 설정
빌드 도구
brew install meson ninja pkgconf
기타 feature/예제 디펜던시
brew install libomp libpng webp jpeg-turbo wgpu-native sdl2
wgpu-native 의 pkg-config shim 설정
WGPU_PREFIX="$(brew --prefix wgpu-native)"
WGPU_VERSION="$(brew list --versions wgpu-native | awk '{print $2}')"
mkdir -p "$HOME/.local/include/webgpu"
ln -sf "$WGPU_PREFIX/include/webgpu.h" "$HOME/.local/include/webgpu/webgpu.h"
mkdir -p "$HOME/.local/lib/pkgconfig"
cat > "$HOME/.local/lib/pkgconfig/wgpu_native.pc" <<EOF
prefix=$WGPU_PREFIX
includedir=\${prefix}/include
libdir=\${prefix}/lib
shimdir=$HOME/.local/include
Name: wgpu_native
Description: Native WebGPU implementation based on wgpu-core
Version: $WGPU_VERSION
Cflags: -I\${shimdir} -I\${includedir}
Libs: -L\${libdir} -lwgpu_native
EOF
cp "$HOME/.local/lib/pkgconfig/wgpu_native.pc" "$HOME/.local/lib/pkgconfig/wgpu-native.pc"
cat <<'EOF' >> ~/.zshrc
export PKG_CONFIG_PATH="$HOME/.local/lib/pkgconfig:$(brew --prefix)/lib/pkgconfig:$PKG_CONFIG_PATH"
EOF
. ~/.zshrc
2. 깃 클론
ThorVG
git clone https://github.com/thorvg/thorvg.git
예제
git clone https://github.com/thorvg/thorvg.example.git
3. 컴파일/설치
ThorVG
cd thorvg
meson setup builddir \
-Dengines=all \
-Dloaders=all \
-Dsavers=all \
-Dbindings=capi \
-Dtools=all \
-Dtests=true \
-Dsimd=true \
-Dthreads=true \
-Dpartial=true \
-Dlog=true \
-Dfile=true \
-Dextra=lottie_exp,openmp
ninja -C builddir install
cd ..
예제
cd thorvg.example
meson setup builddir
ninja -C builddir
cd ..
4. 예제 실행
Animation
./thorvg.example/builddir/src/Animation wg
실행 결과
Lottie
./thorvg.example/builddir/src/Lottie wg
실행 결과
./thorvg.example/builddir/src/CustomTransform wg
실행 결과
댓글
Discussion 원문