MacOS: Build OpenCV CWrapper as Static Library#1341
Conversation
|
While I don't think that building the wrapper as a shared library should be the only option, it does have a benefit: With a shared library we no longer have to add --copy-dt-needed-entries in configure.ac, since we can use $CXX to link ApiWrapper.o. |
|
But that is a workaround needed for Linux only, correct? It should not be needed for Mac. |
|
Then how does macOS know to dynamically link libstdc++ (or whatever its equivalent is called on macOS) to resolve the calls to new and delete? |
|
That's a good question. I guess the Apple linker is able to handle it without needing any extra flags. The configure check for so the linker flag is not passed to FPC: but the game compiles successfully anyway. A quick web search shows that |
|
Would these also need to be changed? https://github.com/UltraStar-Deluxe/USDX/blob/cwrapper/src/Makefile.in#L171 https://github.com/UltraStar-Deluxe/USDX/blob/cwrapper/src/lib/openCV3/opencv_types.pas#L36 also there are |
|
when i did #1243 one challenge was that i am not a mac user and several versions i believed should work, did not immediately work (the webcam did not work then) for the mac users that tested it. how about this PR, I don't know who is a mac user and who is not? |
In #1296 (comment) @bohning reports that Git is tracking
src/lib/openCV3/libopencvwrapper.dylibas a changed file on macOS.For some reason in #1243 a decision was made to build the OpenCV CWrapper as a dynamic library on macOS. This doesn't make sense and it added unnecessary complexity to the build system.
This PR changes the CWrapper to build as a static library on macOS like it does on Linux, and removes the unneeded Mac-specific build system code.