centricular / gstcefsrc

A simple gstreamer wrapper around Chromium Embedded Framework
87 stars 45 forks source link

macOS build issue #14

Closed mstllc closed 4 years ago

mstllc commented 4 years ago

Hey there! Thanks for working on this, it looks like it could be a promising solution to the current problem I'm working on solving :)

Eventually, I'll be running this on a Linux server, but during testing I'm using macOS. When I run the build steps in the README, things go pretty well until the very end. The cmake command downloads cef and extracts it, and everything seems good with the cmake command. When I run the make command, the build process get's through 97% of the process, I see it builds the target libcef_dll_wrapper successfully, but then I see these error lines at the end of the build process:

[ 97%] Linking CXX static library libcef_dll_wrapper.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libcef_dll_wrapper.a(cef_atomicops_x86_gcc.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libcef_dll_wrapper.a(cef_lock.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libcef_dll_wrapper.a(libcef_dll_wrapper2.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libcef_dll_wrapper.a(cef_atomicops_x86_gcc.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libcef_dll_wrapper.a(cef_lock.cc.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: libcef_dll_wrapper.a(libcef_dll_wrapper2.cc.o) has no symbols
[ 97%] Built target libcef_dll_wrapper
Scanning dependencies of target gstcef
[ 97%] Building CXX object CMakeFiles/gstcef.dir/gstcef.cc.o
[ 98%] Building CXX object CMakeFiles/gstcef.dir/gstcefsrc.cc.o
[ 98%] Building CXX object CMakeFiles/gstcef.dir/gstcefdemux.cc.o
[ 99%] Building CXX object CMakeFiles/gstcef.dir/gstcefaudiometa.cc.o
make[2]: *** No rule to make target `libcef_lib-NOTFOUND', needed by `Release/libgstcef.dylib'.  Stop.
make[1]: *** [CMakeFiles/gstcef.dir/all] Error 2
make: *** [all] Error 2

Any idea if there are some different steps I need to take to get this up and running on macOS? I don't have a lot of experience with cef, so maybe it's something I need to do differently in regard to building that?

Any help or pointers would be greatly appreciated! Thanks again!

MathieuDuponchelle commented 4 years ago

I don't necessarily have an idea either, I don't have much experience with cmake I'm afraid. fwiw this element has only been tested / built on windows and linux, so I'm not too surprised that there would be a build issue on OSX. Please do let me know if you find a fix though :)

mstllc commented 4 years ago

No problem, thanks for following up! I have setup Linux in a virtual machine and was able to get the plugin running there, so for now, I'll probably continue down that path. If I end up coming back around to trying to get it working on macOS I will definitely let you know and open a PR if I have a good solution.

Thanks again, closing for now.

MathieuDuponchelle commented 4 years ago

@mstllc good to hear :) Few things worth noting about the plugin:

philn commented 4 years ago

I have a WIP branch for audio support in gstwpe: https://gitlab.freedesktop.org/philn/gst-plugins-bad/-/tree/wpe-audio which depends on https://bugs.webkit.org/show_bug.cgi?id=207634 as well.

reinismu commented 2 years ago

I just got a need to get cefsrc working under MacOS as I need accelerated ProRes encoder.

@mstllc did you mange to get MacOS working in the end?

Will see if I get to root cause of why project doesn't build under MacOS and if I can fix it

Cmake output ``` -- The C compiler identification is AppleClang 13.1.6.13160021 -- The CXX compiler identification is AppleClang 13.1.6.13160021 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Warning at third_party/cef/cef_binary_103.0.9+gd0bbcbb+chromium-103.0.5060.114_macosx64/cmake/cef_variables.cmake:39 (message): No PROJECT_ARCH value specified, using x86_64 Call Stack (most recent call first): third_party/cef/cef_binary_103.0.9+gd0bbcbb+chromium-103.0.5060.114_macosx64/cmake/FindCEF.cmake:38 (include) CMakeLists.txt:42 (find_package) -- Performing Test COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE -- Performing Test COMPILER_SUPPORTS_NO_UNDEFINED_VAR_TEMPLATE - Success -- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2") -- Checking for modules 'gstreamer-1.0;gstreamer-video-1.0;gstreamer-audio-1.0' -- Found gstreamer-1.0, version 1.20.3 -- Found gstreamer-video-1.0, version 1.20.3 -- Found gstreamer-audio-1.0, version 1.20.3 -- Configuring done CMake Warning (dev) in CMakeLists.txt: Policy CMP0111 is not set: An imported target missing its location property fails during generation. Run "cmake --help-policy CMP0111" for policy details. Use the cmake_policy command to set the policy and suppress this warning. IMPORTED_LOCATION not set for imported target "libcef_lib" configuration "Release". This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev) in CMakeLists.txt: Policy CMP0111 is not set: An imported target missing its location property fails during generation. Run "cmake --help-policy CMP0111" for policy details. Use the cmake_policy command to set the policy and suppress this warning. IMPORTED_LOCATION not set for imported target "libcef_lib" configuration "Release". This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev): Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake --help-policy CMP0042" for policy details. Use the cmake_policy command to set the policy and suppress this warning. MACOSX_RPATH is not specified for the following targets: gstcef This warning is for project developers. Use -Wno-dev to suppress it. CMake Warning (dev): Policy CMP0068 is not set: RPATH settings on macOS do not affect install_name. Run "cmake --help-policy CMP0068" for policy details. Use the cmake_policy command to set the policy and suppress this warning. For compatibility with older versions of CMake, the install_name fields for the following targets are still affected by RPATH settings: gstcef This warning is for project developers. Use -Wno-dev to suppress it. -- Generating done ```
Make output ``` [ 92%] Building CXX object libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/wrapper/cef_xml_object.cc.o [ 93%] Building CXX object libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/wrapper/cef_zip_archive.cc.o [ 93%] Building CXX object libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/wrapper/libcef_dll_wrapper.cc.o [ 93%] Building CXX object libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/wrapper/cef_library_loader_mac.mm.o [ 94%] Building CXX object libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/wrapper/libcef_dll_wrapper2.cc.o [ 95%] Building CXX object libcef_dll_wrapper/CMakeFiles/libcef_dll_wrapper.dir/wrapper/libcef_dll_dylib.cc.o [ 96%] Linking CXX static library libcef_dll_wrapper.a /Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcef_dll_wrapper.a(cef_lock.cc.o) has no symbols /Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcef_dll_wrapper.a(libcef_dll_wrapper2.cc.o) has no symbols /Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcef_dll_wrapper.a(cef_lock.cc.o) has no symbols /Library/Developer/CommandLineTools/usr/bin/ranlib: file: libcef_dll_wrapper.a(libcef_dll_wrapper2.cc.o) has no symbols [ 96%] Built target libcef_dll_wrapper make[2]: *** No rule to make target `libcef_lib-NOTFOUND', needed by `Release/gstcefsubprocess'. Stop. make[2]: *** Waiting for unfinished jobs.... [ 96%] Building CXX object CMakeFiles/gstcef.dir/gstcef.cc.o [ 96%] Building CXX object CMakeFiles/gstcefsubprocess.dir/gstcefsubprocess.cc.o [ 96%] Building CXX object CMakeFiles/gstcef.dir/gstcefdemux.cc.o [ 97%] Building CXX object CMakeFiles/gstcef.dir/gstcefsrc.cc.o [ 98%] Building CXX object CMakeFiles/gstcef.dir/gstcefbin.cc.o make[2]: *** No rule to make target `libcef_lib-NOTFOUND', needed by `Release/libgstcef.dylib'. Stop. make[2]: *** Waiting for unfinished jobs.... [ 98%] Building CXX object CMakeFiles/gstcef.dir/gstcefaudiometa.cc.o make[1]: *** [CMakeFiles/gstcefsubprocess.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... make[1]: *** [CMakeFiles/gstcef.dir/all] Error 2 make: *** [all] Error 2 ```
reinismu commented 2 years ago

Seems like this is the answer https://bitbucket.org/chromiumembedded/cef/src/25c75c5fc4fc7d7fbdebdf20ca56ab3162eab570/tests/cefsimple/CMakeLists.txt.in#lines-89 Need to configure Cmake to work for macos. I guess will give it a shot and see how far I get

reinismu commented 2 years ago

Realized that it might take too long for me to finish. Someone who has used cmake to build MacOS libraries would be a better fit to do this. (My attempt https://github.com/centricular/gstcefsrc/compare/master...reinismu:gstcefsrc:macos-support)

We could reopen this issue?

MathieuDuponchelle commented 1 year ago

Hey @reinismu , sorry I'm at the gst hackfest, just noticed your messages. I'm OK with reopening the issue if there is a WIP branch to iterate from, your comment here will be a bit buried though, might be best to open a whole new one?