Skip to content
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

flac: ignore DLL_EXPORT define in export.h #23680

Merged
merged 2 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions recipes/flac/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ sources:
url: "/~https://github.com/xiph/flac/archive/1.3.3.tar.gz"
sha256: "668cdeab898a7dd43cf84739f7e1f3ed6b35ece2ef9968a5c7079fe9adfe1689"
patches:
"1.4.3":
- patch_file: "patches/1.4.2-002-ignore-dll_export-define.patch"
patch_description: "Ignore autotools-specific DLL_EXPORT define in export.h"
patch_type: "conan"
"1.4.2":
- patch_file: "patches/1.4.2-002-ignore-dll_export-define.patch"
patch_description: "Ignore autotools-specific DLL_EXPORT define in export.h"
patch_type: "conan"
"1.3.3":
- patch_file: "patches/fix-cmake-1.3.3.patch"
patch_description: "Various adaptations in CMakeLists.txt files to improve compatibility with Conan."
Expand Down
2 changes: 1 addition & 1 deletion recipes/flac/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def generate(self):
tc.variables["BUILD_EXAMPLES"] = False
tc.variables["BUILD_DOCS"] = False
tc.variables["BUILD_TESTING"] = False
tc.cache_variables["CMAKE_POLICY_DEFAULT_CMP0077"] = "NEW"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What specific error is it fixing? There is no information in the description.

Copy link
Contributor Author

@valgur valgur May 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added it just to be safe. It's almost boilerplate, so I did not see a need to point it out.

The project uses CMake version < 3.12. Without setting the policy, any option() values in CMakeLists.txt might not be overridden by Conan. Even if it has worked ok without it so far, it's bug-prone and can easily become an issue in new releases. It also tends to cause issues silently, if it does.

tc.generate()
cd = CMakeDeps(self)
cd.generate()
Expand Down Expand Up @@ -105,7 +106,6 @@ def package_info(self):
self.cpp_info.components["libflac"].system_libs += ["m"]

bin_path = os.path.join(self.package_folder, "bin")
self.output.info("Appending PATH environment variable: {}".format(bin_path))
self.env_info.PATH.append(bin_path)

# TODO: to remove in conan v2
Expand Down
22 changes: 22 additions & 0 deletions recipes/flac/all/patches/1.4.2-002-ignore-dll_export-define.patch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It makes sense, found similar fix in other places.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- include/FLAC/export.h
+++ include/FLAC/export.h
@@ -74,7 +74,7 @@
*/
#if defined(_WIN32)

-#if defined(FLAC__NO_DLL) && !(defined(DLL_EXPORT))
+#if defined(FLAC__NO_DLL)
#define FLAC_API
#else
#ifdef FLAC_API_EXPORTS
--- include/FLAC++/export.h
+++ include/FLAC++/export.h
@@ -73,7 +73,7 @@
* by libtool, must override FLAC__NO_DLL on building shared components
*/
#if defined(_WIN32)
-#if defined(FLAC__NO_DLL) && !(defined(DLL_EXPORT))
+#if defined(FLAC__NO_DLL)
#define FLACPP_API
#else
#ifdef FLACPP_API_EXPORTS
Loading