@@ -52,11 +52,12 @@ option(BOOST_MATH_BUILD_WITH_LEGACY_FUNCTIONS "Build the C99 and TR1 compiled li
5252if (BOOST_MATH_BUILD_WITH_LEGACY_FUNCTIONS)
5353
5454include (CheckCXXSourceCompiles )
55- get_target_property (_config_type Boost::config TYPE )
56- if (_config_type STREQUAL "INTERFACE_LIBRARY" )
57- get_target_property (_config_inc Boost::config INTERFACE_INCLUDE_DIRECTORIES )
58- else ()
59- set (_config_inc "" )
55+ set (_config_inc "" )
56+ if (NOT BOOST_MATH_STANDALONE)
57+ get_target_property (_config_type Boost::config TYPE )
58+ if (_config_type STREQUAL "INTERFACE_LIBRARY" )
59+ get_target_property (_config_inc Boost::config INTERFACE_INCLUDE_DIRECTORIES )
60+ endif ()
6061endif ()
6162set (CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR} /include" ${_config_inc} )
6263check_cxx_source_compiles ("#include <${CMAKE_CURRENT_SOURCE_DIR} /config/has_long_double_support.cpp> \n int main() { return 0;}" BOOST_MATH_HAS_LONG_DOUBLE )
@@ -130,22 +131,29 @@ list(TRANSFORM TR1_SOURCES APPEND ".cpp")
130131foreach (type IN LISTS types)
131132 add_library (boost_math_tr1${type} ${TR1_SOURCES${type}} )
132133 add_library (Boost::math_tr1${type} ALIAS boost_math_tr1${type} )
133- target_link_libraries (boost_math_tr1${type} PUBLIC Boost::config )
134+ if (NOT BOOST_MATH_STANDALONE)
135+ target_link_libraries (boost_math_tr1${type} PUBLIC Boost::config )
136+ endif ()
134137 target_include_directories (boost_math_tr1${type} PRIVATE src/tr1 )
135138 target_include_directories (boost_math_tr1${type} PRIVATE include )
136139
137140 add_library (boost_math_c99${type} ${C99_SOURCES${type}} )
138141 add_library (Boost::math_c99${type} ALIAS boost_math_c99${type} )
139- target_link_libraries (boost_math_c99${type} PUBLIC Boost::config )
142+ if (NOT BOOST_MATH_STANDALONE)
143+ target_link_libraries (boost_math_c99${type} PUBLIC Boost::config )
144+ endif ()
140145 target_include_directories (boost_math_c99${type} PRIVATE src/tr1 )
141146 target_include_directories (boost_math_c99${type} PRIVATE include )
142147
143148 if (BUILD_SHARED_LIBS )
144149 target_compile_definitions (boost_math_tr1${type} PUBLIC BOOST_MATH_TR1_DYN_LINK=1 )
145150 target_compile_definitions (boost_math_c99${type} PUBLIC BOOST_MATH_TR1_DYN_LINK=1 )
146- if (MSVC )
151+ if (WIN32 )
147152 target_compile_definitions (boost_math_tr1${type} PRIVATE "BOOST_SYMBOL_EXPORT=__declspec(dllexport)" BOOST_ALL_NO_LIB )
148153 target_compile_definitions (boost_math_c99${type} PRIVATE "BOOST_SYMBOL_EXPORT=__declspec(dllexport)" BOOST_ALL_NO_LIB )
154+ else ()
155+ target_compile_definitions (boost_math_tr1${type} PRIVATE "BOOST_SYMBOL_EXPORT=__attribute__((visibility(\" default\" )))" BOOST_ALL_NO_LIB )
156+ target_compile_definitions (boost_math_c99${type} PRIVATE "BOOST_SYMBOL_EXPORT=__attribute__((visibility(\" default\" )))" BOOST_ALL_NO_LIB )
149157 endif ()
150158 endif ()
151159
0 commit comments