File tree 3 files changed +4
-2
lines changed
3 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ target_include_directories(PULSAR_OBJECT_LIB PUBLIC
76
76
"${CMAKE_SOURCE_DIR} /include"
77
77
"${CMAKE_BINARY_DIR} /include" )
78
78
79
+ option (LINK_STATIC_GCC_CXX "Link statically to libgcc and libstdc++" OFF )
79
80
include (CheckCXXSymbolExists)
80
81
if (BUILD_DYNAMIC_LIB)
81
82
add_library (pulsarShared SHARED $<TARGET_OBJECTS:PULSAR_OBJECT_LIB>)
@@ -94,7 +95,7 @@ if (BUILD_DYNAMIC_LIB)
94
95
target_link_options (pulsarShared PRIVATE -Wl,-Bsymbolic)
95
96
endif ()
96
97
check_cxx_symbol_exists(__GLIBCXX__ iostream GLIBCXX)
97
- if (GLIBCXX)
98
+ if (GLIBCXX AND LINK_STATIC_GCC_CXX )
98
99
target_link_libraries (pulsarShared PUBLIC -static -libgcc -static -libstdc++)
99
100
endif ()
100
101
endif ()
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ pushd $CPP_DIR
41
41
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
42
42
43
43
chmod +x $( find . -name " *.sh" )
44
- cmake . -DBUILD_TESTS=OFF -DBUILD_PERF_TOOLS=OFF -DLINK_STATIC=ON
44
+ cmake . -DBUILD_TESTS=OFF -DBUILD_PERF_TOOLS=OFF -DLINK_STATIC=ON -DLINK_STATIC_GCC_CXX=ON
45
45
make -j 3
46
46
popd
47
47
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ static library.
55
55
%build
56
56
git clone https://github.com/microsoft/vcpkg.git
57
57
cmake -B build -DINTEGRATE_VCPKG=ON -DCMAKE_BUILD_TYPE=Release \
58
+ -DLINK_STATIC_GCC_CXX=ON \
58
59
-DBUILD_TESTS=OFF -DBUILD_DYNAMIC_LIB=ON -DBUILD_STATIC_LIB=ON
59
60
cmake --build build -j8
60
61
./build-support/merge_archives_vcpkg.sh $PWD /build
You can’t perform that action at this time.
0 commit comments