Skip to content

Commit

Permalink
Explicitly reference symbols to re-export
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Jun 28, 2019
1 parent d767b6a commit 0187188
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
1 change: 1 addition & 0 deletions libs/config/CMakeLists.txt
Expand Up @@ -33,6 +33,7 @@ set(config_headers

# Default location is $HPX_ROOT/libs/config/src
set(config_sources
force_linking.cpp
version.cpp
)

Expand Down
8 changes: 7 additions & 1 deletion libs/config/include/hpx/config/force_linking.hpp
Expand Up @@ -8,7 +8,13 @@

namespace hpx { namespace config
{
void force_linking();
struct force_linking_helper
{
const char* const hpx_version;
const char* const boost_version;
};

force_linking_helper& force_linking();
}}

#endif
20 changes: 20 additions & 0 deletions libs/config/src/force_linking.cpp
@@ -0,0 +1,20 @@
// Copyright (c) 2019 The STE||AR GROUP
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#include <hpx/config/force_linking.hpp>
#include <hpx/config/version.hpp>

namespace hpx { namespace config
{
// reference all symbols that have to be explicitly linked with the core
// library
force_linking_helper& force_linking()
{
static force_linking_helper helper{
hpx::HPX_CHECK_VERSION, hpx::HPX_CHECK_BOOST_VERSION};
return helper;
}
}}

6 changes: 0 additions & 6 deletions libs/config/src/version.cpp
Expand Up @@ -7,7 +7,6 @@
////////////////////////////////////////////////////////////////////////////////

#include <hpx/config/export_definitions.hpp>
#include <hpx/config/force_linking.hpp>
#include <hpx/config/version.hpp>
#include <hpx/preprocessor/stringize.hpp>

Expand All @@ -18,9 +17,4 @@ namespace hpx
HPX_PP_STRINGIZE(HPX_CHECK_VERSION);
HPX_EXPORT char const HPX_CHECK_BOOST_VERSION[] =
HPX_PP_STRINGIZE(HPX_CHECK_BOOST_VERSION);

namespace config
{
void force_linking() {}
}
}

0 comments on commit 0187188

Please sign in to comment.