Closed7
OBSを自前ビルドする@macOS

情報がねぇ

環境:
macOS 14.6
Xcode 15.4
cmake 3.29.2

git cloneして、cmake --list-presetsまでは問題ない

- 問題1
option -r not recognized
usage: xattr [-slz] file [file ...] ...
xattrにそんなオプションはない、とのエラー
- 原因
https://apple.stackexchange.com/questions/472652/when-invoking-xattr-with-r-flag-get-error-option-r-not-recognized
これと同じ。
自分の場合はpyenvのxattrと競合していた - 対策
cmake/macos/buildspec.cmakeの、
execute_process(COMMAND xattr -d com.apple.quarantine "${dependencies_dir}/${destination}"
RESULT_VARIABLE result ERROR_QUIET)
を
execute_process(COMMAND /usr/bin/xattr -d com.apple.quarantine "${dependencies_dir}/${destination}"
RESULT_VARIABLE result ERROR_QUIET)
にしてxattrを明示的に設定すると動いた

- 問題2
obs-studio/deps/libcaption/src/utf8.c:126:15 Possible misuse of comma operator here
などのエラーでビルドできない。
- 原因
XCodeの警告レベルが強い。 - 対応
Projectのobs-studio > build setting > Apple Clang - Custom Compiler flags > Other Warning Flags
に、
-Wno-comma
を追加して黙らせる。
他にも、
Code will never be executed
Unused parameter
も出るので、
-Wno-unreachable-code
-Wno-unused-parameter
も追加しておく

これでビルド通るはず

このままだとプラグインを作るときに困る、ブレークポイントが打てないため
cmakeのところに戻って
cmake --preset macos -DCMAKE_BUILD_TYPE=Debug
これで任意のタイミングで止まる
このスクラップは2024/08/10にクローズされました