Skip to content

Commit

Permalink
usse of crt static link and fix regex name agent configuration (#1679) (
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-christophe81 authored Sep 10, 2024
1 parent 08a5078 commit 3085ab0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
3 changes: 3 additions & 0 deletions CMakeListsWindows.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ add_definitions("-DCOLLECT_MAJOR=${COLLECT_MAJOR}")
add_definitions("-DCOLLECT_MINOR=${COLLECT_MINOR}")
add_definitions("-DCOLLECT_PATCH=${COLLECT_PATCH}")

if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
set (CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded")
endif()

# There is a bug with grpc. It is not put in the triplet directory. So we have
# to search for its plugin.
Expand Down
6 changes: 3 additions & 3 deletions agent/src/config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,10 @@ config::config(const std::string& path) {
_endpoint = json_config.get_string("endpoint");

// pattern schema doesn't work so we do it ourselves
if (!RE2::FullMatch(_endpoint, "[\\w\\.:]+:\\w+")) {
if (!RE2::FullMatch(_endpoint, "[\\w\\.\\-:]+:\\w+")) {
throw exceptions::msg_fmt(
"bad format for endpoint {}, it must match to the regex: "
"[\\w\\.:]+:\\w+",
"bad format for endpoint {}, it must match the regex: "
"[\\w\\.\\-:]+:\\w+",
_endpoint);
}
_log_level =
Expand Down
6 changes: 3 additions & 3 deletions agent/src/config_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ config::config(const std::string& registry_key) {
_endpoint = get_sz_reg_or_default("endpoint", "");

// pattern schema doesn't work so we do it ourselves
if (!RE2::FullMatch(_endpoint, "[\\w\\.:]+:\\w+")) {
if (!RE2::FullMatch(_endpoint, "[\\w\\.\\-:]+:\\w+")) {
RegCloseKey(h_key);
throw exceptions::msg_fmt(
"bad format for endpoint {}, it must match to the regex: "
"[\\w\\.:]+:\\w+",
"bad format for endpoint {}, it must match the regex: "
"[\\w\\.\\-:]+:\\w+",
_endpoint);
}
_log_level =
Expand Down
2 changes: 1 addition & 1 deletion custom-triplets/x64-windows.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_CRT_LINKAGE static)
set(VCPKG_LIBRARY_LINKAGE static)

#set(VCPKG_CMAKE_SYSTEM_NAME windows)
Expand Down

0 comments on commit 3085ab0

Please sign in to comment.