Skip to content

Commit

Permalink
Static linking works now (Fixes #934)
Browse files Browse the repository at this point in the history
  • Loading branch information
sithhell committed Jul 21, 2014
1 parent 236df6b commit ee25143
Show file tree
Hide file tree
Showing 21 changed files with 109 additions and 657 deletions.
12 changes: 3 additions & 9 deletions CMakeLists.txt
Expand Up @@ -146,6 +146,7 @@ hpx_option(WITH_STATIC_LINKING BOOL
if(WITH_STATIC_LINKING)
hpx_add_config_define(HPX_STATIC_LINKING)
set(hpx_library_link_mode STATIC)
set(CMAKE_SHARED_LIBS OFF)
else()
set(hpx_library_link_mode SHARED)
endif()
Expand All @@ -157,6 +158,7 @@ hpx_option(WITH_TESTS BOOL "Build the HPX tests (default ON)" ON)
hpx_option(WITH_TESTS_BENCHMARKS BOOL "Build HPX benchmark tests (default: ON)" ON ADVANCED)
hpx_option(WITH_TESTS_REGRESSIONS BOOL "Build HPX regression tests (default: ON)" ON ADVANCED)
hpx_option(WITH_TESTS_UNIT BOOL "Build HPX unit tests (default: ON)" ON ADVANCED)
hpx_option(WITH_TOOLS BOOL "Build HPX tools (default: OFF)" OFF ADVANCED)
hpx_option(WITH_RUNTIME BOOL "Build HPX runtime (default: ON)" ON ADVANCED)

hpx_option(WITH_FULL_RPATH BOOL "Build and link HPX libraries and executables with full RPATHs (default: ON)" ON ADVANCED)
Expand Down Expand Up @@ -1138,9 +1140,8 @@ set(HPX_DEBUG_POSTFIX "d")
# executable to run. The same process will walk through the project's entire
# directory structure.

hpx_option(HPX_BUILD_TOOLS BOOL "Build HPX tools (default: OFF)" OFF ADVANCED)

if(HPX_BUILD_TOOLS OR HPX_STATIC_LINKING)
if(WITH_TOOLS)
add_hpx_pseudo_target(tools)
add_subdirectory(tools)
endif()
Expand Down Expand Up @@ -1187,13 +1188,6 @@ if(WITH_RUNTIME)
add_subdirectory(runtime)
endif()

# hpx_option(HPX_BUILD_TOOLS BOOL "Build HPX tools (default: OFF)" OFF ADVANCED)
#
# if(HPX_BUILD_TOOLS)
# add_hpx_pseudo_target(tools)
# add_subdirectory(tools)
# endif()

if(WITH_DOCUMENTATION)
add_subdirectory(docs)
endif()
Expand Down
4 changes: 2 additions & 2 deletions cmake/HPX_AddComponent.cmake
Expand Up @@ -101,7 +101,7 @@ macro(add_hpx_component name)
if(${name}_EXCLUDE_FROM_ALL)
set(exclude_from_all EXCLUDE_FROM_ALL)
else()
if(${name}_PLUGIN AND NOT WITH_STATIC_BUILD)
if(${name}_PLUGIN AND NOT WITH_STATIC_LINKING)
set(install_destination lib/hpx)
set(${name}_OUTPUT_SUFFIX lib/hpx)
else()
Expand All @@ -120,7 +120,7 @@ macro(add_hpx_component name)
if(${${name}_STATIC})
set(${name}_lib_linktype STATIC)
else()
if(WITH_STATIC_BUILD)
if(WITH_STATIC_LINKING)
set(${name}_lib_linktype STATIC)
else()
set(${name}_lib_linktype SHARED)
Expand Down
7 changes: 3 additions & 4 deletions cmake/HPX_AddLibrary.cmake
Expand Up @@ -88,12 +88,11 @@ macro(add_hpx_library name)

set(exclude_from_all)
set(install_options)
if(${name}_EXCLUDE_FROM_ALL)

if(NOT HPX_EXTERNAL_CMAKE)
if(${name}_EXCLUDE_FROM_ALL)
set(exclude_from_all EXCLUDE_FROM_ALL)
else()
if(${name}_PLUGIN AND NOT WITH_STATIC_BUILD)
if(${name}_PLUGIN AND NOT WITH_STATIC_LINKING)
set(install_destination lib/hpx)
set(${name}_OUTPUT_SUFFIX lib/hpx)
else()
Expand All @@ -116,7 +115,7 @@ macro(add_hpx_library name)
if(${${name}_STATIC})
set(${name}_lib_linktype STATIC)
else()
if(WITH_STATIC_BUILD)
if(WITH_STATIC_LINKING)
set(${name}_lib_linktype STATIC)
else()
set(${name}_lib_linktype SHARED)
Expand Down
3 changes: 3 additions & 0 deletions cmake/HPX_SetupBoost.cmake
Expand Up @@ -5,6 +5,9 @@

# We first try to find the required minimum set of Boost libraries. This will
# also give us the version of the found boost installation
if(WITH_STATIC_LINKING)
set(Boost_USE_STATIC_LIBS ON)
endif()
find_package(Boost
1.49
REQUIRED
Expand Down
8 changes: 4 additions & 4 deletions cmake/HPX_SetupTarget.cmake
Expand Up @@ -111,10 +111,10 @@ function(hpx_setup_target target)

# linker instructions
if(NOT target_NOLIBS)
set(hpx_libs hpx hpx_serialization)
if(NOT nohpxinit)
set(hpx_libs ${hpx_libs} hpx_init)
endif()
set(hpx_libs hpx)# hpx_serialization)
# if(NOT nohpxinit)
# set(hpx_libs ${hpx_libs} hpx_init)
# endif()
hpx_handle_component_dependencies(target_COMPONENT_DEPENDENCIES)
set(hpx_libs ${hpx_libs} ${target_COMPONENT_DEPENDENCIES})
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
Expand Down
79 changes: 0 additions & 79 deletions cmake/HPX_StaticComponentList.cmake

This file was deleted.

110 changes: 0 additions & 110 deletions cmake/templates/static_component_data.hpp.in

This file was deleted.

0 comments on commit ee25143

Please sign in to comment.