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

Missing build type definitions #7

Open
dutow opened this issue Oct 3, 2017 · 2 comments
Open

Missing build type definitions #7

dutow opened this issue Oct 3, 2017 · 2 comments

Comments

@dutow
Copy link

dutow commented Oct 3, 2017

The boost thread library build depends on the existence of the BOOST_THREAD_BUILD_LIB (static) or BOOST_THREAD_BUILD_DLL (dynamic) definitions.

In the normal build, it is defined in its Jamfile.

Without one of these defined, it marks functions defined in cpp files with dllimport on Windows.

The following addition to its CMakeLists solves the problem:

if (BUILD_SHARED_LIBS)
    target_compile_definitions(boost_thread PRIVATE BOOST_THREAD_BUILD_DLL)
else()
    target_compile_definitions(boost_thread PRIVATE BOOST_THREAD_BUILD_LIB)
endif()
@dutow
Copy link
Author

dutow commented Oct 3, 2017

This isn't the only missing definitions - for example, I just noticed that while most libraries define BOOST_{NAME}_SOURCE in all of their cpp files, context defines BOOST_CONTEXT_SOURCE in its Jamfile, and without it, it won't add the dllexport specifiers.

So it also should be added to the CMakeLists in context:

target_compile_definitions(boost_context PRIVATE BOOST_CONTEXT_SOURCE)

I missed this (and probably others too) before because I've only built a static version so far, and unlike thread, the other libraries default to declarations without import/export symbols.

(uh, and sorry for opening all these as issues, but with a 1-commit repository with this recent commit date and older issues, I'm assuming you are just force pushing / rewriting a single commit)

@pfultz2
Copy link
Member

pfultz2 commented Oct 3, 2017

uh, and sorry for opening all these as issues, but with a 1-commit repository with this recent commit date and older issues, I'm assuming you are just force pushing / rewriting a single commit

I do push a single new commit since it is generated from a script, but you can still do PRs and I will merge the changes into the scripts as well.

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

No branches or pull requests

2 participants