File tree Expand file tree Collapse file tree 3 files changed +4
-2
lines changed
Expand file tree Collapse file tree 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
7676 "${CMAKE_SOURCE_DIR} /include"
7777 "${CMAKE_BINARY_DIR} /include" )
7878
79+ option (LINK_STATIC_GCC_CXX "Link statically to libgcc and libstdc++" OFF )
7980include (CheckCXXSymbolExists)
8081if (BUILD_DYNAMIC_LIB)
8182 add_library (pulsarShared SHARED $<TARGET_OBJECTS:PULSAR_OBJECT_LIB>)
@@ -94,7 +95,7 @@ if (BUILD_DYNAMIC_LIB)
9495 target_link_options (pulsarShared PRIVATE -Wl,-Bsymbolic)
9596 endif ()
9697 check_cxx_symbol_exists(__GLIBCXX__ iostream GLIBCXX)
97- if (GLIBCXX)
98+ if (GLIBCXX AND LINK_STATIC_GCC_CXX )
9899 target_link_libraries (pulsarShared PUBLIC -static -libgcc -static -libstdc++)
99100 endif ()
100101endif ()
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ pushd $CPP_DIR
4141export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
4242
4343chmod +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
4545make -j 3
4646popd
4747
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ static library.
5555%build
5656git clone https://github.com/microsoft/vcpkg.git
5757cmake -B build -DINTEGRATE_VCPKG=ON -DCMAKE_BUILD_TYPE=Release \
58+ -DLINK_STATIC_GCC_CXX=ON \
5859 -DBUILD_TESTS=OFF -DBUILD_DYNAMIC_LIB=ON -DBUILD_STATIC_LIB=ON
5960cmake --build build -j8
6061./build-support/merge_archives_vcpkg.sh $PWD /build
You can’t perform that action at this time.
0 commit comments