Skip to content

Commit cf454fe

Browse files
authored
[cppmicroservices] update and devendor stuff (microsoft#42720)
1 parent 1bf29ad commit cf454fe

File tree

6 files changed

+195
-30
lines changed

6 files changed

+195
-30
lines changed
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index 55b99bb765..85b4484990 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -692,9 +692,9 @@ endif()
6+
#-----------------------------------------------------------------------------
7+
# Compile libraries here if you do not want -Werror or /WX on
8+
#-----------------------------------------------------------------------------
9+
-add_subdirectory(third_party/absl)
10+
+find_package(absl CONFIG REQUIRED)
11+
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries" FORCE)
12+
-add_subdirectory(third_party/boost/nowide)
13+
+find_package(Boost COMPONENTS nowide CONFIG REQUIRED)
14+
set(BUILD_SHARED_LIBS ${_us_build_shared} CACHE BOOL "Build shared libraries" FORCE)
15+
#-----------------------------------------------------------------------------
16+
17+
diff --git a/cmake/usBundleConfig.cmake.in b/cmake/usBundleConfig.cmake.in
18+
index c9cf743790..078c5b3fad 100644
19+
--- a/cmake/usBundleConfig.cmake.in
20+
+++ b/cmake/usBundleConfig.cmake.in
21+
@@ -3,6 +3,10 @@
22+
set(US_@PROJECT_NAME@_LIBRARIES @PROJECT_TARGET@)
23+
set(US_@PROJECT_NAME@_RUNTIME_LIBRARY_DIRS "@PACKAGE_CONFIG_RUNTIME_LIBRARY_DIR@")
24+
25+
+include(CMakeFindDependencyMacro)
26+
+find_dependency(Boost COMPONENTS asio nowide CONFIG)
27+
+find_dependency(absl CONFIG)
28+
+
29+
if(NOT TARGET @PROJECT_TARGET@)
30+
include("${CMAKE_CURRENT_LIST_DIR}/us@[email protected]")
31+
endif()
32+
diff --git a/compendium/CMakeLists.txt b/compendium/CMakeLists.txt
33+
index a5713313ec..d26ac7e4fe 100644
34+
--- a/compendium/CMakeLists.txt
35+
+++ b/compendium/CMakeLists.txt
36+
@@ -1,3 +1,4 @@
37+
+find_package(Boost COMPONENTS asio CONFIG REQUIRED)
38+
if(US_BUILD_TESTING)
39+
add_subdirectory(test_bundles)
40+
endif()
41+
diff --git a/compendium/ConfigurationAdmin/src/CMAsyncWorkService.cpp b/compendium/ConfigurationAdmin/src/CMAsyncWorkService.cpp
42+
index 50f02e6e1f..fdfa45d991 100644
43+
--- a/compendium/ConfigurationAdmin/src/CMAsyncWorkService.cpp
44+
+++ b/compendium/ConfigurationAdmin/src/CMAsyncWorkService.cpp
45+
@@ -22,10 +22,10 @@
46+
47+
#include "CMAsyncWorkService.hpp"
48+
49+
-#include "boost/asio/async_result.hpp"
50+
-#include "boost/asio/packaged_task.hpp"
51+
-#include "boost/asio/post.hpp"
52+
-#include "boost/asio/thread_pool.hpp"
53+
+#include <boost/asio/async_result.hpp>
54+
+#include <boost/asio/packaged_task.hpp>
55+
+#include <boost/asio/post.hpp>
56+
+#include <boost/asio/thread_pool.hpp>
57+
58+
namespace cppmicroservices
59+
{
60+
diff --git a/compendium/ConfigurationAdmin/src/CMakeLists.txt b/compendium/ConfigurationAdmin/src/CMakeLists.txt
61+
index f2eca66ce7..8d7c8bd671 100644
62+
--- a/compendium/ConfigurationAdmin/src/CMakeLists.txt
63+
+++ b/compendium/ConfigurationAdmin/src/CMakeLists.txt
64+
@@ -25,7 +25,7 @@ set(_private_headers
65+
)
66+
67+
add_library(ConfigurationAdminObjs OBJECT ${_srcs} ${_private_headers})
68+
-
69+
+target_link_libraries(ConfigurationAdminObjs PULBIC Boost::asio)
70+
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
71+
get_property(_compile_flags TARGET ConfigurationAdminObjs PROPERTY COMPILE_FLAGS)
72+
set_property(TARGET ConfigurationAdminObjs PROPERTY COMPILE_FLAGS "${_compile_flags} -fPIC")
73+
diff --git a/compendium/DeclarativeServices/CMakeLists.txt b/compendium/DeclarativeServices/CMakeLists.txt
74+
index 24f2820fa5..cb518781b4 100644
75+
--- a/compendium/DeclarativeServices/CMakeLists.txt
76+
+++ b/compendium/DeclarativeServices/CMakeLists.txt
77+
@@ -37,14 +37,14 @@ endif()
78+
add_compile_definitions(BOOST_DATE_TIME_NO_LIB)
79+
add_compile_definitions(BOOST_REGEX_NO_LIB)
80+
81+
-
82+
+find_package(Boost COMPONENTS asio CONFIG REQUIRED)
83+
usMacroCreateBundle(DeclarativeServices
84+
VERSION "1.5.10"
85+
DEPENDS Framework
86+
TARGET DeclarativeServices
87+
SYMBOLIC_NAME declarative_services
88+
EMBED_RESOURCE_METHOD LINK
89+
- LINK_LIBRARIES ${_link_libraries} usServiceComponent usAsyncWorkService
90+
+ LINK_LIBRARIES ${_link_libraries} usServiceComponent usAsyncWorkService Boost::asio
91+
PRIVATE_HEADERS ${_ds_private_headers}
92+
SOURCES $<TARGET_OBJECTS:DeclarativeServicesObjs> src/SCRActivator.cpp
93+
BINARY_RESOURCES manifest.json
94+
diff --git a/compendium/DeclarativeServices/src/CMakeLists.txt b/compendium/DeclarativeServices/src/CMakeLists.txt
95+
index d25961b6d7..9283babe46 100644
96+
--- a/compendium/DeclarativeServices/src/CMakeLists.txt
97+
+++ b/compendium/DeclarativeServices/src/CMakeLists.txt
98+
@@ -79,8 +79,9 @@ set(_private_headers
99+
metadata/ServiceMetadata.hpp
100+
metadata/Util.hpp
101+
)
102+
-
103+
+find_package(Boost COMPONENTS asio CONFIG REQUIRED)
104+
add_library(DeclarativeServicesObjs OBJECT ${_srcs} ${_private_headers})
105+
+target_link_libraries(DeclarativeServicesObjs PUBLIC Boost::asio)
106+
107+
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
108+
get_property(_compile_flags TARGET DeclarativeServicesObjs PROPERTY COMPILE_FLAGS)
109+
diff --git a/compendium/DeclarativeServices/src/SCRAsyncWorkService.cpp b/compendium/DeclarativeServices/src/SCRAsyncWorkService.cpp
110+
index ffc93e9e86..1b9af7bd6c 100644
111+
--- a/compendium/DeclarativeServices/src/SCRAsyncWorkService.cpp
112+
+++ b/compendium/DeclarativeServices/src/SCRAsyncWorkService.cpp
113+
@@ -22,10 +22,10 @@
114+
115+
#include "SCRAsyncWorkService.hpp"
116+
117+
-#include "boost/asio/async_result.hpp"
118+
-#include "boost/asio/packaged_task.hpp"
119+
-#include "boost/asio/post.hpp"
120+
-#include "boost/asio/thread_pool.hpp"
121+
+#include <boost/asio/async_result.hpp>
122+
+#include <boost/asio/packaged_task.hpp>
123+
+#include <boost/asio/post.hpp>
124+
+#include <boost/asio/thread_pool.hpp>
125+
126+
namespace cppmicroservices
127+
{
128+
diff --git a/compendium/DeclarativeServices/src/manager/ComponentConfigurationImpl.cpp b/compendium/DeclarativeServices/src/manager/ComponentConfigurationImpl.cpp
129+
index c4483a98c1..84d4217e7a 100644
130+
--- a/compendium/DeclarativeServices/src/manager/ComponentConfigurationImpl.cpp
131+
+++ b/compendium/DeclarativeServices/src/manager/ComponentConfigurationImpl.cpp
132+
@@ -30,7 +30,7 @@
133+
#include "ReferenceManager.hpp"
134+
#include "ReferenceManagerImpl.hpp"
135+
#include "RegistrationManager.hpp"
136+
-#include "boost/asio/post.hpp"
137+
+#include <boost/asio/post.hpp>
138+
#include "cppmicroservices/servicecomponent/ComponentConstants.hpp"
139+
#include "states/CCUnsatisfiedReferenceState.hpp"
140+
#include "states/ComponentConfigurationState.hpp"
141+
diff --git a/tools/rc/CMakeLists.txt b/tools/rc/CMakeLists.txt
142+
index c4a36f8dd1..ffcf13e44a 100644
143+
--- a/tools/rc/CMakeLists.txt
144+
+++ b/tools/rc/CMakeLists.txt
145+
@@ -19,9 +19,8 @@ set_property(TARGET ${US_RCC_EXECUTABLE_TARGET} PROPERTY OUTPUT_NAME ${US_RCC_EX
146+
if(WIN32)
147+
target_link_libraries(${US_RCC_EXECUTABLE_TARGET} Shlwapi)
148+
endif()
149+
-
150+
-target_link_libraries(${US_RCC_EXECUTABLE_TARGET} nowide::nowide)
151+
-target_include_directories(${US_RCC_EXECUTABLE_TARGET} PRIVATE ${CppMicroServices_SOURCE_DIR}/third_party/boost/nowide/include)
152+
+find_package(Boost COMPONENTS nowide CONFIG REQUIRED)
153+
+target_link_libraries(${US_RCC_EXECUTABLE_TARGET} Boost::nowide)
154+
155+
set_property(TARGET ${US_RCC_EXECUTABLE_TARGET} APPEND PROPERTY
156+
COMPILE_DEFINITIONS "MINIZ_NO_ARCHIVE_READING_API;MINIZ_NO_ZLIB_COMPATIBLE_NAMES")
157+
diff --git a/tools/rc/ResourceCompiler.cpp b/tools/rc/ResourceCompiler.cpp
158+
index a5b81d3522..4e92db4e3a 100644
159+
--- a/tools/rc/ResourceCompiler.cpp
160+
+++ b/tools/rc/ResourceCompiler.cpp
161+
@@ -37,9 +37,12 @@
162+
#include <utility>
163+
#include <vector>
164+
165+
-#include <nowide/args.hpp>
166+
-#include <nowide/fstream.hpp>
167+
+#include <boost/nowide/args.hpp>
168+
+#include <boost/nowide/fstream.hpp>
169+
170+
+namespace nowide {
171+
+ using namespace boost::nowide;
172+
+}
173+
#include "optionparser.h"
174+
#include "json/json.h"
175+

ports/cppmicroservices/portfile.cmake

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,31 @@ vcpkg_from_github(
22
OUT_SOURCE_PATH SOURCE_PATH
33
REPO CppMicroServices/CppMicroservices
44
REF "v${VERSION}"
5-
SHA512 4743846a8ba45e6bd320c93bb3bd443b5dac16ea0bbf55bda6212e9200a40ee29031fd74c6141de4c6b5ef9ad3e70789d13fda25b40638547782d386a12dd7e2
5+
SHA512 26b76b124fba50a079b002867f5d349b4719833358f09712a73bc3f4370362bc27b01eb7ba31e3a0d01f101f70e5be45d5d99fe9f25216eadacc02127459d91b
66
HEAD_REF development
77
PATCHES
88
werror.patch
99
fix_strnicmp.patch
10-
remove-wx.patch
10+
devendor_boost_absl.patch
1111
)
1212

13-
#nowide download
14-
vcpkg_from_github(
15-
OUT_SOURCE_PATH NOWIDE_SOURCE_PATH
16-
REPO boostorg/nowide
17-
REF 02f40f0b5f5686627fcddae93ff88ca399db4766
18-
SHA512 e68e0704896726c7a94b8ace0e03c5206b4c7acd23a6b05f6fb2660abe30611ac6913cf5fab7b57eaff1990a7c28aeee8c9f526b60f7094c0c201f90b715d6c6
19-
HEAD_REF develop
13+
# TODO: De-vendor everything
14+
file(REMOVE_RECURSE
15+
"${SOURCE_PATH}/third_party/absl"
16+
"${SOURCE_PATH}/third_party/boost"
2017
)
2118

22-
file(REMOVE_RECURSE "${SOURCE_PATH}/third_party/boost/nowide")
23-
file(RENAME "${NOWIDE_SOURCE_PATH}" "${SOURCE_PATH}/third_party/boost/nowide")
24-
2519
vcpkg_cmake_configure(
2620
SOURCE_PATH "${SOURCE_PATH}"
2721
OPTIONS
2822
-DTOOLS_INSTALL_DIR:STRING=tools/cppmicroservices
2923
-DAUXILIARY_INSTALL_DIR:STRING=share/cppmicroservices
3024
-DUS_USE_SYSTEM_GTEST=TRUE
25+
-DUS_BUILD_TESTING=FALSE
26+
-DUS_USE_SYSTEM_BOOST=TRUE
3127
)
3228

33-
vcpkg_cmake_install()
29+
vcpkg_cmake_install(ADD_BIN_TO_PATH)
3430

3531
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
3632

ports/cppmicroservices/remove-wx.patch

Lines changed: 0 additions & 13 deletions
This file was deleted.

ports/cppmicroservices/vcpkg.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
22
"name": "cppmicroservices",
3-
"version": "3.7.6",
4-
"port-version": 1,
3+
"version": "3.8.4",
54
"description": "An OSGi-like C++ dynamic module system and service registry",
65
"homepage": "https://github.com/CppMicroServices/CppMicroServices",
76
"license": "Apache-2.0",
87
"dependencies": [
8+
"abseil",
9+
"boost-asio",
10+
"boost-nowide",
911
"gtest",
1012
{
1113
"name": "vcpkg-cmake",

versions/baseline.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,8 +1977,8 @@
19771977
"port-version": 0
19781978
},
19791979
"cppmicroservices": {
1980-
"baseline": "3.7.6",
1981-
"port-version": 1
1980+
"baseline": "3.8.4",
1981+
"port-version": 0
19821982
},
19831983
"cppp-reiconv": {
19841984
"baseline": "2.1.0",

versions/c-/cppmicroservices.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"versions": [
3+
{
4+
"git-tree": "6139bba03bcfb25bcf76fca8ef1a2b3124eb63a1",
5+
"version": "3.8.4",
6+
"port-version": 0
7+
},
38
{
49
"git-tree": "b438280ccc1012bda6457141a3dea8071711ffb9",
510
"version": "3.7.6",

0 commit comments

Comments
 (0)