Skip to content

Commit 7d0a600

Browse files
author
nikolai.shipilov
committed
Clean-up boost external dependency
1 parent c75cb45 commit 7d0a600

File tree

2 files changed

+6
-60
lines changed

2 files changed

+6
-60
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ add_definitions(-DFMT_HEADER_ONLY)
4040
option(${REPO_OPTION_PREFIX}_EXAMPLE_ENABLE_APP "Enable building example application" OFF)
4141
option(${REPO_OPTION_PREFIX}_ENABLE_TESTS "Enable tests" OFF)
4242

43+
# Runtime and default 3rd party library linking options
44+
option(${REPO_OPTION_PREFIX}_LINK_RUNTIME_STATICALLY "Link the C++ runtime staticaly (embedd it)" OFF)
45+
option(${REPO_OPTION_PREFIX}_LINK_3RD_PARTY_LIBS_STATICALY "Link the 3rd party libraries staticaly (embedd it)" ON)
46+
4347
include(CommonUtils)
4448
setup_repo(${REPO_OPTION_PREFIX})
4549

external/boost/CMakeLists.txt

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
if (OPENDAQ_LINK_3RD_PARTY_LIBS_STATICALY)
1+
if (${REPO_OPTION_PREFIX}_LINK_3RD_PARTY_LIBS_STATICALY)
22
set(BUILD_SHARED_LIBS OFF)
33
set(Boost_USE_STATIC_LIBS ON CACHE BOOL "")
44
message(STATUS "Linking Boost statically")
@@ -12,7 +12,7 @@ set(Boost_USE_MULTITHREADED ON)
1212
set(Boost_USE_STATIC_RUNTIME ${OPENDAQ_LINK_RUNTIME_STATICALLY})
1313
set(Boost_NO_WARN_NEW_VERSIONS ON)
1414

15-
if (OPENDAQ_LINK_RUNTIME_STATICALLY)
15+
if (${REPO_OPTION_PREFIX}_LINK_RUNTIME_STATICALLY)
1616
set(BOOST_RUNTIME_LINK static)
1717
else()
1818
set(BOOST_RUNTIME_LINK shared)
@@ -41,23 +41,10 @@ if (NOT BOOST_INCLUDE_LIBRARIES)
4141
set(NEEDED_LIBRARIES algorithm
4242
asio
4343
beast
44-
dll
4544
program_options
4645
uuid
47-
locale
48-
align
49-
5046
)
5147

52-
if(DAQMODULES_PARQUET_RECORDER_MODULE AND MSVC)
53-
list(APPEND NEEDED_LIBRARIES
54-
multiprecision
55-
predef
56-
scope_exit
57-
typeof
58-
)
59-
endif()
60-
6148
set(BOOST_INCLUDE_LIBRARIES "${NEEDED_LIBRARIES}"
6249
CACHE STRING
6350
"List of libraries to build (default: all but excluded and incompatible)"
@@ -90,51 +77,6 @@ if (Boost_FETCHED)
9077
endif()
9178
endif()
9279
endforeach()
93-
94-
if(DAQMODULES_PARQUET_RECORDER_MODULE)
95-
set(boost_libs
96-
config
97-
algorithm
98-
assert
99-
bind
100-
concept_check
101-
core
102-
detail
103-
function
104-
iterator
105-
locale
106-
mpl
107-
numeric_conversion
108-
preprocessor
109-
range
110-
smart_ptr
111-
static_assert
112-
throw_exception
113-
tokenizer
114-
type_traits
115-
utility
116-
mp11
117-
)
118-
119-
if(MSVC)
120-
list(APPEND boost_libs
121-
multiprecision
122-
predef
123-
scope_exit
124-
typeof
125-
126-
)
127-
endif()
128-
129-
add_library(daq::boost_headers INTERFACE IMPORTED GLOBAL)
130-
131-
foreach(boost_lib ${boost_libs})
132-
if (TARGET Boost::${boost_lib})
133-
get_target_property(include_dirs Boost::${boost_lib} INTERFACE_INCLUDE_DIRECTORIES)
134-
target_include_directories(daq::boost_headers INTERFACE "${include_dirs}")
135-
endif()
136-
endforeach()
137-
endif()
13880
endif()
13981

14082
if (Boost_FOUND)

0 commit comments

Comments
 (0)