Skip to content

Commit

Permalink
Static link
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Nov 29, 2023
1 parent 41ff58d commit cc50744
Show file tree
Hide file tree
Showing 14 changed files with 54 additions and 44 deletions.
6 changes: 0 additions & 6 deletions cmake_modules/BaseFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,6 @@ function(dsn_add_static_library)
dsn_install_library()
endfunction(dsn_add_static_library)

function(dsn_add_shared_library)
set(MY_PROJ_TYPE "SHARED")
dsn_add_project()
dsn_install_library()
endfunction(dsn_add_shared_library)

function(dsn_add_executable)
set(MY_PROJ_TYPE "EXECUTABLE")
dsn_add_project()
Expand Down
2 changes: 1 addition & 1 deletion src/block_service/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ dsn_add_static_library()

add_subdirectory(hdfs)
add_subdirectory(local)
add_subdirectory(test)
#add_subdirectory(test)
3 changes: 3 additions & 0 deletions src/block_service/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ set(MY_PROJ_LIBS
hdfs
test_utils
rocksdb)
ssl
crypto
)

set(MY_BOOST_LIBS Boost::system Boost::filesystem)

Expand Down
2 changes: 1 addition & 1 deletion src/client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ set(MY_PROJ_SRC "")
# "GLOB" for non-recursive search
set(MY_SRC_SEARCH_MODE "GLOB")

set(MY_PROJ_LIBS "")
set(MY_PROJ_LIBS dsn_utils)

# Extra files that will be installed
set(MY_BINPLACES "")
Expand Down
18 changes: 11 additions & 7 deletions src/client/replication_ddl_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ DSN_DEFINE_uint32(ddl_client,
"The retry interval after receiving error from meta server.");

namespace dsn {

using utils::hostname_from_ip_port;
using utils::list_hostname_from_ip_port;

namespace replication {

#define VALIDATE_TABLE_NAME(app_name) \
Expand Down Expand Up @@ -513,8 +517,8 @@ std::string host_name_resolve(bool resolve_ip, std::string value)
{
if (resolve_ip) {
std::string temp;
if (dsn::utils::hostname_from_ip_port(value.c_str(), &temp))
return temp;
// if (hostname_from_ip_port(value.c_str(), &temp))
// return temp;
}
return value;
}
Expand Down Expand Up @@ -676,11 +680,11 @@ replication_ddl_client::cluster_info(const std::string &file_name, bool resolve_

if (resolve_ip) {
for (int i = 0; i < resp.keys.size(); ++i) {
if (resp.keys[i] == "meta_servers") {
dsn::utils::list_hostname_from_ip_port(resp.values[i].c_str(), &resp.values[i]);
} else if (resp.keys[i] == "primary_meta_server") {
dsn::utils::hostname_from_ip_port(resp.values[i].c_str(), &resp.values[i]);
}
// if (resp.keys[i] == "meta_servers") {
// list_hostname_from_ip_port(resp.values[i].c_str(), &resp.values[i]);
// } else if (resp.keys[i] == "primary_meta_server") {
// hostname_from_ip_port(resp.values[i].c_str(), &resp.values[i]);
// }
}
}

Expand Down
1 change: 1 addition & 0 deletions src/failure_detector/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ set(MY_PROJ_LIBS
dsn_replica_server
dsn_replication_common
dsn.failure_detector
dsn.block_service
gtest
hashtable
rocksdb)
Expand Down
2 changes: 1 addition & 1 deletion src/meta/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ set(MY_BINPLACES "")

add_definitions(-DDSN_MOCK_TEST)

dsn_add_shared_library()
dsn_add_static_library()

add_subdirectory(test)
40 changes: 20 additions & 20 deletions src/meta/meta_state_service_simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,26 +97,26 @@ void meta_state_service_simple::write_log(blob &&log_blob,
_task_queue.emplace(move(continuation_task));
_log_lock.unlock();

file::write(_log,
log_blob.data(),
log_blob.length(),
log_offset,
LPC_META_STATE_SERVICE_SIMPLE_INTERNAL,
&_tracker,
[=](error_code err, size_t bytes) {
CHECK(err == ERR_OK && bytes == log_blob.length(),
"we cannot handle logging failure now");
_log_lock.lock();
continuation_task_ptr->done = true;
while (!_task_queue.empty()) {
if (!_task_queue.front()->done) {
break;
}
_task_queue.front()->cb(true);
_task_queue.pop();
}
_log_lock.unlock();
});
// ::dsn::file::write(_log,
// log_blob.data(),
// log_blob.length(),
// log_offset,
// LPC_META_STATE_SERVICE_SIMPLE_INTERNAL,
// &_tracker,
// [=](error_code err, size_t bytes) {
// CHECK(err == ERR_OK && bytes == log_blob.length(),
// "we cannot handle logging failure now");
// _log_lock.lock();
// continuation_task_ptr->done = true;
// while (!_task_queue.empty()) {
// if (!_task_queue.front()->done) {
// break;
// }
// _task_queue.front()->cb(true);
// _task_queue.pop();
// }
// _log_lock.unlock();
// });
}

error_code meta_state_service_simple::create_node_internal(const std::string &node,
Expand Down
4 changes: 3 additions & 1 deletion src/meta/test/meta_state/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ set(MY_PROJ_LIBS
dsn_replica_server
dsn_replication_common
dsn_runtime
hashtable
gtest
zookeeper
hashtable
dsn.replication.zookeeper_provider
)

set(MY_BOOST_LIBS Boost::system Boost::filesystem)
Expand Down
2 changes: 1 addition & 1 deletion src/replica/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ set(MY_BOOST_LIBS Boost::filesystem)
# Extra files that will be installed
set(MY_BINPLACES "")

dsn_add_shared_library()
dsn_add_static_library()

add_subdirectory(duplication/test)
add_subdirectory(backup/test)
Expand Down
1 change: 1 addition & 0 deletions src/replica/backup/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ set(MY_SRC_SEARCH_MODE "GLOB")
set(MY_PROJ_LIBS dsn_meta_server
dsn_replica_server
dsn_replication_common
dsn_runtime
dsn.block_service
dsn.block_service.local
dsn_utils
Expand Down
10 changes: 9 additions & 1 deletion src/runtime/ranger/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ set(MY_PROJ_NAME dsn_ranger)
# "GLOB" for non-recursive search
set(MY_SRC_SEARCH_MODE "GLOB")

set(MY_PROJ_LIBS "")
set(MY_PROJ_LIBS
galaxy-fds-sdk-cpp
PocoNet
PocoFoundation
PocoNetSSL
PocoJSON
PocoCrypto
PocoXML
PocoUtil)

# Extra files that will be installed
set(MY_BINPLACES "")
Expand Down
1 change: 1 addition & 0 deletions src/shell/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ set(MY_PROJ_LIBS
dsn_meta_server
dsn_replication_common
dsn_client
dsn_dist_cmd
dsn_utils
dsn.block_service.local
dsn.block_service.hdfs
Expand Down
6 changes: 1 addition & 5 deletions src/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ set(MY_PROJ_LIBS dsn_http rocksdb)
# Extra files that will be installed
set(MY_BINPLACES "")

if (APPLE)
dsn_add_static_library()
else()
dsn_add_shared_library()
endif()
dsn_add_static_library()

add_subdirectory(long_adder_bench)
add_subdirectory(test)

0 comments on commit cc50744

Please sign in to comment.