diff --git a/cmake/HPX_AddModule.cmake b/cmake/HPX_AddModule.cmake index f735011adc6b..8f48aae8093d 100644 --- a/cmake/HPX_AddModule.cmake +++ b/cmake/HPX_AddModule.cmake @@ -100,12 +100,26 @@ function(add_hpx_module name) ) endif() + set(force_linking_header "${CMAKE_BINARY_DIR}/hpx/${name}/force_linking.hpp") + # Add a header to force linking of modules on Windows + FILE(WRITE ${force_linking_header} + "// Copyright (c) 2019 The STE||AR GROUP\n" + "//\n" + "// Distributed under the Boost Software License, Version 1.0. (See accompanying\n" + "// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)\n" + "\n" + "namespace hpx { namespace config\n" + "{\n" + " void force_linking();\n" + "}}\n" + ) + foreach(header_file ${headers}) hpx_debug(${header_file}) endforeach(header_file) add_library(hpx_${name} STATIC ${sources} ${headers} ${global_header} ${compat_headers}) - + target_link_libraries(hpx_${name} ${${name}_DEPENDENCIES}) target_include_directories(hpx_${name} PUBLIC $ @@ -173,7 +187,7 @@ function(add_hpx_module name) COMPONENT ${name} ) endif() - + write_config_defines_file( NAMESPACE ${name_upper} FILENAME "${CMAKE_BINARY_DIR}/hpx/${name}/config/defines.hpp") @@ -185,5 +199,5 @@ function(add_hpx_module name) foreach(dir ${${name}_CMAKE_SUBDIRS}) add_subdirectory(${dir}) endforeach(dir) - + endfunction(add_hpx_module) diff --git a/libs/cache/CMakeLists.txt b/libs/cache/CMakeLists.txt index 3c8025d843a6..cb4b7224da6d 100644 --- a/libs/cache/CMakeLists.txt +++ b/libs/cache/CMakeLists.txt @@ -9,7 +9,6 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") # Default location is $HPX_ROOT/libs/cache/include set(cache_headers - hpx/cache/force_linking.hpp hpx/cache/local_cache.hpp hpx/cache/lru_cache.hpp hpx/cache/entries/entry.hpp diff --git a/libs/cache/include/hpx/cache/force_linking.hpp b/libs/cache/include/hpx/cache/force_linking.hpp deleted file mode 100644 index 3712a699a2d7..000000000000 --- a/libs/cache/include/hpx/cache/force_linking.hpp +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) 2019 Hartmut Kaiser -// -// 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) - -/////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace cache -{ - void force_linking(); -}} diff --git a/libs/config/CMakeLists.txt b/libs/config/CMakeLists.txt index 5134a263ba80..cb01563148b0 100644 --- a/libs/config/CMakeLists.txt +++ b/libs/config/CMakeLists.txt @@ -22,7 +22,6 @@ set(config_headers hpx/config/emulate_deleted.hpp hpx/config/export_definitions.hpp hpx/config/forceinline.hpp - hpx/config/force_linking.hpp hpx/config/lambda_capture.hpp hpx/config/manual_profiling.hpp hpx/config/threads_stack.hpp diff --git a/libs/config/include/hpx/config/force_linking.hpp b/libs/config/include/hpx/config/force_linking.hpp deleted file mode 100644 index 76a349617989..000000000000 --- a/libs/config/include/hpx/config/force_linking.hpp +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) 2019 Hartmut Kaiser -// -// 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) - -/////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace config -{ - void force_linking(); -}} diff --git a/libs/preprocessor/CMakeLists.txt b/libs/preprocessor/CMakeLists.txt index 4db15f74ca20..e0c00c6f9717 100644 --- a/libs/preprocessor/CMakeLists.txt +++ b/libs/preprocessor/CMakeLists.txt @@ -12,7 +12,6 @@ set(preprocessor_headers hpx/preprocessor/cat.hpp hpx/preprocessor/config.hpp hpx/preprocessor/expand.hpp - hpx/preprocessor/force_linking.hpp hpx/preprocessor/nargs.hpp hpx/preprocessor/stringize.hpp hpx/preprocessor/strip_parens.hpp diff --git a/libs/preprocessor/include/hpx/preprocessor/force_linking.hpp b/libs/preprocessor/include/hpx/preprocessor/force_linking.hpp deleted file mode 100644 index a3f17b54f9ee..000000000000 --- a/libs/preprocessor/include/hpx/preprocessor/force_linking.hpp +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) 2019 Hartmut Kaiser -// -// 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) - -/////////////////////////////////////////////////////////////////////////////// -namespace hpx { namespace preprocessor -{ - void force_linking(); -}}