"
DEAL_II_HAVE_GLIBC_STACKTRACE)
-if(DEAL_II_HAVE_GLIBC_STACKTRACE AND NOT DEAL_II_STATIC_EXECUTABLE)
+if(DEAL_II_HAVE_GLIBC_STACKTRACE)
enable_if_links(DEAL_II_LINKER_FLAGS "-rdynamic")
endif()
set(DEAL_II_MPIEXEC_PREFLAGS "@MPIEXEC_PREFLAGS@")
set(DEAL_II_MPIEXEC_POSTFLAGS "@MPIEXEC_POSTFLAGS@")
-#
-# Build a static executable:
-#
-
-set(DEAL_II_STATIC_EXECUTABLE "@DEAL_II_STATIC_EXECUTABLE@")
-
-
#
# Information about include directories and libraries
#
target_link_libraries(${_target} ${DEAL_II_TARGET_${_build}})
endif()
- #
- # If DEAL_II_STATIC_EXECUTABLE is set, switch the final link type to
- # static:
- #
- if(DEAL_II_STATIC_EXECUTABLE)
- set_property(TARGET ${_target} PROPERTY
- LINK_SEARCH_END_STATIC TRUE
- )
- endif()
-
endmacro()
#
# This macro toggles the preference for static/shared libraries if
-# DEAL_II_PREFER_STATIC_LIBS=TRUE but the final executable will still be
-# dynamically linked, i.e. DEAL_II_STATIC_EXECUTABLE=OFF
+# DEAL_II_PREFER_STATIC_LIBS=TRUE.
#
# Usage:
# switch_library_preference()
#
macro(switch_library_preference)
- if(DEAL_II_PREFER_STATIC_LIBS AND NOT DEAL_II_STATIC_EXECUTABLE)
+ if(DEAL_II_PREFER_STATIC_LIBS)
#
# Invert the search order for libraries when DEAL_II_PREFER_STATIC_LIBS
# is set. This will prefer static archives instead of shared libraries:
# DEAL_II_EARLY_DEPRECATIONS
# BUILD_SHARED_LIBS
# DEAL_II_PREFER_STATIC_LIBS
-# DEAL_II_STATIC_EXECUTABLE
# CMAKE_INSTALL_RPATH_USE_LINK_PATH
# DEAL_II_CXX_FLAGS *)
# DEAL_II_CXX_FLAGS_DEBUG
)
mark_as_advanced(DEAL_II_PREFER_STATIC_LIBS)
-option(DEAL_II_STATIC_EXECUTABLE
- "Provide a link interface that is suitable for static linkage of executables. Enabling this option forces BUILD_SHARED_LIBS=OFF and DEAL_II_PREFER_STATIC_LIBS=ON"
- OFF
- )
-mark_as_advanced(DEAL_II_STATIC_EXECUTABLE)
-
-if(DEAL_II_STATIC_EXECUTABLE)
- set(BUILD_SHARED_LIBS "OFF" CACHE BOOL
- "Build a shared library"
- FORCE
- )
- set(DEAL_II_PREFER_STATIC_LIBS "ON" CACHE BOOL
- "Prefer static libraries over dynamic libraries when searching for features and corresponding link interface"
- FORCE
- )
-endif()
-
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE BOOL
"Set the rpath of the library to the external link paths on installation"
)
endif()
-if(DEAL_II_STATIC_EXECUTABLE)
- #
- # To produce a static executable, we have to statically link libstdc++
- # and gcc's support libraries and glibc:
- #
- enable_if_supported(DEAL_II_LINKER_FLAGS "-static")
- enable_if_supported(DEAL_II_LINKER_FLAGS "-pthread")
-endif()
-
-
#############################
# #
# For Release target: #
enable_if_supported(DEAL_II_CXX_FLAGS "-wd280")
-if(DEAL_II_STATIC_EXECUTABLE)
- #
- # To produce a static executable, we have to statically link intel's
- # support libraries:
- #
- enable_if_supported(DEAL_II_LINKER_FLAGS "-static")
- enable_if_supported(DEAL_II_LINKER_FLAGS "-static-intel")
- enable_if_supported(DEAL_II_LINKER_FLAGS "-static-gcc")
- enable_if_supported(DEAL_II_LINKER_FLAGS "-pthread")
-else()
- #
- # Explicitly link intel support libraries dynamically:
- #
- enable_if_supported(DEAL_II_LINKER_FLAGS "-shared-intel")
-endif()
-
-
#############################
# #
# For Release target: #
)
endif()
-if(DEAL_II_STATIC_EXECUTABLE)
- _both(
- "#\n# STATIC LINKAGE!\n"
- )
-endif()
-
_both("#\n")
_detailed(
to true, static archives will be preferred over dynamic libraries when
searching for features and corresponding link interface.
- <li>
- <code>DEAL_II_STATIC_EXECUTABLE</code> (defaults to off):
- If set to true, <acronym>deal.II</acronym> will be configured in
- a way to provide a link interface that is suitable for static
- linkage of executables. Enabling this option forces
- <code>BUILD_SHARED_LIBS=OFF</code> and
- <code>DEAL_II_PREFER_STATIC_LIBS=ON</code>.
-
<li>
<code>CMAKE_INSTALL_RPATH_USE_LINK_PATH</code>: If set
(default), the <acronym>deal.II</acronym> library will be
DEAL_II_MPIEXEC_PREFLAGS
DEAL_II_MPIEXEC_POSTFLAGS
-
-DEAL_II_STATIC_EXECUTABLE - true if the link interface is set up to
- compile resulting executables statically
-
#
# Information about include directories and libraries
#
# set(DEAL_II_EARLY_DEPRECATIONS OFF CACHE BOOL "")
# set(BUILD_SHARED_LIBS "ON" CACHE BOOL "")
# set(DEAL_II_PREFER_STATIC_LIBS "OFF" CACHE BOOL "")
-# set(DEAL_II_STATIC_EXECUTABLE "OFF" CACHE BOOL "")
# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH "ON" CACHE BOOL "")
#