diff --git a/libs/config/CMakeLists.txt b/libs/config/CMakeLists.txt index 70ad7a369a2e..93926595f9f5 100644 --- a/libs/config/CMakeLists.txt +++ b/libs/config/CMakeLists.txt @@ -33,6 +33,7 @@ set(config_headers # Default location is $HPX_ROOT/libs/config/src set(config_sources + force_linking.cpp version.cpp ) diff --git a/libs/config/src/force_linking.cpp b/libs/config/src/force_linking.cpp new file mode 100644 index 000000000000..cad025c9c275 --- /dev/null +++ b/libs/config/src/force_linking.cpp @@ -0,0 +1,21 @@ +// 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 +#include + +namespace hpx { namespace config +{ + // reference all symbols that have to be explicitly linked with the core + // library + void force_linking() + { + const char* const hpx_version = hpx::HPX_CHECK_VERSION; + const char* const boost_version = hpx::HPX_CHECK_BOOST_VERSION; + (void)hpx_version; + (void)boost_version; + } +}} + diff --git a/libs/config/src/version.cpp b/libs/config/src/version.cpp index e0f8fba3981d..88ef082a77df 100644 --- a/libs/config/src/version.cpp +++ b/libs/config/src/version.cpp @@ -18,9 +18,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() {} - } }