Open Wohlstand opened 6 years ago
Original comment by jimbo1qaz (Bitbucket: jimbo1qaz, ).
OS: Ubuntu 18.04.
Ended up importing the library using add_subdirectory(game-music-emu)
which worked.
Configuring static linking was difficult for me to find how to work. After much suffering, I found that SET(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared GME library")
worked.
However, static linking ended up triggering thousands of linker errors, since -static-libubsan
wasn't passed to GCC. To fix this issue, I partially modernized CMakeLists:
cxx_flags
insteadset_target_properties
with cxx_flags
on each project in the dir (uses BUILDSYSTEM_TARGETS which requires CMake 3.7)target_link_libraries(gme ${cxx_flags})
on GME only. See Github diff.
target_link_libraries
, or only pass -static-libubsan
.Now, target_link_libraries(towave PRIVATE gme)
automatically inherits -static-libubsan
.
https://github.com/jimbo1qaz/towave-j/commits/master/game-music-emu I think I should squash the 2 commits before sending a PR here.
Original comment by Michael Pyne (Bitbucket: mpyne, GitHub: mpyne).
I added the CMake support before I realized that there was a difference between CMake config mode and module mode for FindPackage.
Although I'm mainly a C++ dev myself, the pkg-config interface is currently the only supported export interface (and that's in the gme/CMakeLists.txt
, not the toplevel). That's mostly just due to lack of time, I'd be happy to add the proper CMake bits.
Original report by jimbo1qaz (Bitbucket: jimbo1qaz, ).
I'm new to CMake, and am trying to setup CMake for
towave
in order to link statically with this library (instead of Ubuntu's bundled gme with poor ym2612 emulation). Does this library support find_package?https://www.youtube.com/watch?v=eC9-iRN2b04 ?
https://stackoverflow.com/questions/22450776/generate-find-cmake-automatically-and-install-it-for-importing ?