-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[vcpkg baseline][openal-soft/libmikmod] Fix OSX build #23683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index 40fa4ee..78ad3f9 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -799,8 +799,8 @@ ELSE() | ||
| ENDIF(ENABLE_SDL) | ||
|
|
||
| IF (ENABLE_OPENAL) | ||
| - include(FindOpenAL) | ||
| - IF (OPENAL_FOUND) | ||
| + find_package(OpenAL CONFIG REQUIRED) | ||
| + IF (1) | ||
| SET (DRV_OPENAL 1) | ||
| CHECK_MULTI_INCLUDE_FILES("AL/al.h" "AL/alc.h") | ||
| IF (HAVE_AL_AL_H) | ||
| @@ -811,7 +811,10 @@ IF (ENABLE_OPENAL) | ||
| #include <AL/alext.h> | ||
| int main() {return 0;}" HAVE_AL_ALEXT_H) | ||
| ENDIF() | ||
| - LIST (APPEND EXTRA_LIBS ${OPENAL_LIBRARY}) | ||
| + LIST (APPEND EXTRA_LIBS OpenAL::OpenAL) | ||
| + if (APPLE) | ||
| + LIST (APPEND EXTRA_LIBS c++) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still think this shouldn't be done here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No that doesn't help.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It won't export the library. The consuming CMake project (libmikmod) shall use the C++ linker. To do that, the exporting project (openal-soft) shall export CXX as the linking language, and the consuming project (libmikmod) shall enable CXX language to know the linker binary. But in the end, you have to hard code the c++ lib into the pc file. Interesting that Linux didn't complain about missing symbols. |
||
| + endif() | ||
JackBoosY marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ELSE() | ||
| SET (ENABLE_OPENAL 0) | ||
| SET (DRV_OPENAL) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,10 @@ | ||
| { | ||
| "name": "libmikmod", | ||
| "version-string": "3.3.11.1", | ||
| "port-version": 10, | ||
| "version": "3.3.11.1", | ||
| "port-version": 11, | ||
| "description": "Mikmod is a module player and library supporting many formats, including mod, s3m, it, and xm.", | ||
| "homepage": "https://sourceforge.net/projects/mikmod/", | ||
| "license": "GPL-2.0-only", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. README: LGPL 2.0 or later (plus some extra attribution for parts of the code). |
||
| "dependencies": [ | ||
| "openal-soft" | ||
| ] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| index 0cf0613..f1ac2ed 100644 | ||
| --- a/CMakeLists.txt | ||
| +++ b/CMakeLists.txt | ||
| @@ -1211,7 +1211,7 @@ set(IMPL_TARGET OpenAL) # Either OpenAL or soft_oal. | ||
| if(LIBTYPE STREQUAL "STATIC") | ||
| add_library(${IMPL_TARGET} STATIC ${COMMON_OBJS} ${OPENAL_OBJS} ${ALC_OBJS} ${CORE_OBJS}) | ||
| target_compile_definitions(${IMPL_TARGET} PUBLIC AL_LIBTYPE_STATIC) | ||
| - target_link_libraries(${IMPL_TARGET} PRIVATE ${LINKER_FLAGS} ${EXTRA_LIBS} ${MATH_LIB}) | ||
| + target_link_libraries(${IMPL_TARGET} PRIVATE ${LINKER_FLAGS} PUBLIC ${EXTRA_LIBS} ${MATH_LIB}) | ||
| if(WIN32) | ||
| # This option is for static linking OpenAL Soft into another project | ||
| # that already defines the IDs. It is up to that project to ensure all | ||
| @@ -1263,7 +1263,7 @@ else() | ||
| if(WIN32) | ||
| set_target_properties(${IMPL_TARGET} PROPERTIES PREFIX "") | ||
| endif() | ||
| - target_link_libraries(${IMPL_TARGET} PRIVATE common ${LINKER_FLAGS} ${EXTRA_LIBS} ${MATH_LIB}) | ||
| + target_link_libraries(${IMPL_TARGET} PRIVATE common ${LINKER_FLAGS} PUBLIC ${EXTRA_LIBS} ${MATH_LIB}) | ||
|
|
||
| if(APPLE AND ALSOFT_OSX_FRAMEWORK) | ||
| # Sets framework name to soft_oal to avoid ambiguity with the system OpenAL.framework |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ vcpkg_from_github( | |
| HEAD_REF master | ||
| PATCHES | ||
| dont-export-symbols-in-static-build.patch | ||
| fix-export-libs.patch | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO this patch is not needed at all. |
||
| ) | ||
|
|
||
| if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,9 @@ | ||
| { | ||
| "name": "openal-soft", | ||
| "version-semver": "1.21.1", | ||
| "port-version": 4, | ||
| "port-version": 5, | ||
| "description": "OpenAL Soft is an LGPL-licensed, cross-platform, software implementation of the OpenAL 3D audio API.", | ||
| "homepage": "https://github.com/kcat/openal-soft", | ||
| "license": "GPL-2.0-only", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGPL. |
||
| "supports": "!uwp" | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My preferred form of minimal patching would be:
This would be all which is needed to get the needed
OPENAL_<...>variables.