Skip to content

Conversation

@ych
Copy link
Contributor

@ych ych commented Jul 5, 2019

Boost does not provide pkg-config file, so if execute
'pkg-config --exists cppkafka' command with boost dependency,
user always gets non-zero return. And PKG_SEARCH_MODULE in cmake
use the command to check the status of cppkafka.

The boost dependency should be removed for general usage can be works.

@accelerated
Copy link
Contributor

@ych, do you have to add boost manually on the link line? Maybe there's a flag in pkg-config to skip unknown .pc files instead of throwing an error? Our boost installs have .pc files for instance, but I think it's more of a company artifact than something standard.

@ych
Copy link
Contributor Author

ych commented Jul 9, 2019

@accelerated If cppkafka really need Boost but Boost is not supported in pkg-config, it should put to Cflags field. (please refer https://people.freedesktop.org/~dbn/pkg-config-guide.html, "Cflags: The compiler flags specific to this package and any required libraries that don't support pkg-config.")

But I try to find out where cppkafka using Boost, and I find out that Boost only is used in the example program for program options. pkg-config is a way to describe how to use the library, it does not need to include the library which only the example program used.

@accelerated
Copy link
Contributor

@ych, in that case we have to bring back -I@Boost_INCLUDE_DIRS@ in CFlags because CppKafka uses boost::optional which is header-only file. boost::program_options are used in tests only. This is what I originally had but i was unaware that open source boost distros don't provide a .pc file. So my testing was not failing because our company generates these .pc files.

@ych
Copy link
Contributor Author

ych commented Jul 10, 2019

@accelerated ok, I only use ldd command to check executable files and library files, so I ignore the boost::optional part.

I add @Boost_INCLUDE_DIRS@ to pkg-config template file, it will be converted correctly by configure_file command in CMakeLists.txt.

@accelerated
Copy link
Contributor

@ych, can you please fix the conflict so this can be merged?

ych added 2 commits September 5, 2019 11:49
Boost not provide pkg-config file, so if execute
 'pkg-config --exist cppkafka' command with boost dependency,
 user always gets non-zero return. And PKG_SEARCH_MODULE in cmake
 use the command to check the status of cppkafka.

The boost dependency should be removed for general usage can be works.
@ych
Copy link
Contributor Author

ych commented Sep 5, 2019

Sorry, I did not notice the comment.

The conflict should be fixed now.

@mfontanini
Copy link
Owner

@accelerated are you good with this one? I don't use pkg-config so I'm not sure what are the implications of this.

@accelerated
Copy link
Contributor

Yes I recently heard from another source that pkg_config if broken if used with cmake because of boost, so I say it should be removed.

@mfontanini mfontanini merged commit c3b4580 into mfontanini:master Sep 5, 2019
@mfontanini
Copy link
Owner

Perfect. Thanks @ych and @accelerated!

@ych ych deleted the pc_config branch September 19, 2019 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants