diff --git a/bin/package.rb b/bin/package.rb index 8cd9b575..040076f6 100755 --- a/bin/package.rb +++ b/bin/package.rb @@ -38,7 +38,7 @@ def which(name, extra_locations = []) output_dir = Dir.mktmpdir("cxx_output_") output_tarball = File.join(output_dir, "cache.tar") cpm_cache_dir = Dir.mktmpdir("cxx_cache_") -cxx_core_build_dir = Dir.mktmpdir("cxx_build_") +cxx_core_build_dir = Dir.mktmpdir("cxx_build_") cc = ENV.fetch("CB_CC", nil) cxx = ENV.fetch("CB_CXX", nil) ar = ENV.fetch("CB_AR", nil) @@ -90,6 +90,7 @@ def which(name, extra_locations = []) "asio/*/asio/COPYING", "asio/*/asio/asio/include/*.hpp", "asio/*/asio/asio/include/asio/**/*.[hi]pp", + "asio/*/asio/asio/src/*.cpp", "boringssl/*/boringssl/**/*.{cc,h,c,asm,S}", "boringssl/*/boringssl/**/CMakeLists.txt", "boringssl/*/boringssl/LICENSE", @@ -292,7 +293,5 @@ def traverse(document, reader, writer) main_header = File.read(File.join(project_root, "src/php_couchbase.hxx")) sdk_version = main_header[/PHP_COUCHBASE_VERSION "(\d+\.\d+\.\d+)"/, 1] snapshot = ENV.fetch("BUILD_NUMBER", 0).to_i - if snapshot > 0 - FileUtils.mv("couchbase-#{sdk_version}.tgz", "couchbase-#{sdk_version}.#{snapshot}.tgz", verbose: true) - end + FileUtils.mv("couchbase-#{sdk_version}.tgz", "couchbase-#{sdk_version}.#{snapshot}.tgz", verbose: true) if snapshot > 0 end diff --git a/config.w32 b/config.w32 index e4394a1c..2543bf9d 100644 --- a/config.w32 +++ b/config.w32 @@ -73,6 +73,9 @@ if (PHP_COUCHBASE != "no") { ' -D COUCHBASE_PHP_INCLUDES="' + COUCHBASE_PHP_INCLUDES + '"' + ' -D COUCHBASE_PHP_LIB="' + COUCHBASE_PHP_LIB + '"' + ' -D COUCHBASE_PHP_LIBDIR="' + get_define("BUILD_DIR") + '"' + + ' -D COUCHBASE_CXX_CLIENT_INSTALL=OFF ' + + ' -D COUCHBASE_CXX_CLIENT_BUILD_SHARED=OFF ' + + ' -D COUCHBASE_CXX_CLIENT_BUILD_STATIC=OON ' + ' -D COUCHBASE_CXX_CLIENT_BUILD_EXAMPLES=OFF ' + ' -D COUCHBASE_CXX_CLIENT_BUILD_TOOLS=OFF ' + ' -D COUCHBASE_CXX_CLIENT_BUILD_DOCS=OFF ' + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index daee5b86..83e5442f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,12 +23,16 @@ set(COUCHBASE_CXX_CLIENT_BUILD_TESTS set(COUCHBASE_CXX_CLIENT_BUILD_TOOLS OFF CACHE BOOL "" FORCE) +set(COUCHBASE_CXX_CLIENT_BUILD_STATIC + ON + CACHE BOOL "" FORCE) set(COUCHBASE_CXX_CLIENT_BUILD_SHARED OFF CACHE BOOL "" FORCE) set(COUCHBASE_CXX_CLIENT_STATIC_BORINGSSL ON CACHE BOOL "" FORCE) +set(COUCHBASE_CXX_CLIENT_INSTALL OFF CACHE BOOL "" FORCE) set(CMAKE_POSITION_INDEPENDENT_CODE ON) add_subdirectory(deps/couchbase-cxx-client) @@ -83,16 +87,19 @@ endif() if(MSVC) set_target_properties(couchbase PROPERTIES PREFIX "php_" IMPORT_PREFIX "php_") endif() -target_include_directories(couchbase PRIVATE ${PROJECT_BINARY_DIR}/generated) -target_include_directories(couchbase PRIVATE ${PROJECT_SOURCE_DIR}/deps/couchbase-cxx-client) -target_include_directories(couchbase PRIVATE ${PHP_INCLUDE_DIRS}) +target_include_directories(couchbase SYSTEM PRIVATE + ${PHP_INCLUDE_DIRS} + ${PROJECT_BINARY_DIR}/generated + ${PROJECT_SOURCE_DIR}/deps/couchbase-cxx-client + ${PROJECT_SOURCE_DIR}/deps/couchbase-cxx-client/third_party/cxx_function + ${PROJECT_SOURCE_DIR}/deps/couchbase-cxx-client/third_party/expected/include) target_compile_definitions(couchbase PRIVATE ZEND_COMPILE_DL_EXT=1) -set_target_properties(couchbase_cxx_client PROPERTIES C_VISIBILITY_PRESET hidden CXX_VISIBILITY_PRESET hidden) +set_target_properties(couchbase_cxx_client_static PROPERTIES C_VISIBILITY_PRESET hidden CXX_VISIBILITY_PRESET hidden) target_link_libraries( couchbase PRIVATE project_options project_warnings - couchbase_cxx_client + couchbase_cxx_client_static spdlog::spdlog taocpp::json fmt::fmt diff --git a/src/deps/couchbase-cxx-client b/src/deps/couchbase-cxx-client index 58d46d79..51f4775e 160000 --- a/src/deps/couchbase-cxx-client +++ b/src/deps/couchbase-cxx-client @@ -1 +1 @@ -Subproject commit 58d46d79578c8e4ca88e934c3ae8982abaa89ff9 +Subproject commit 51f4775e56fb9ba975f92d7791d4d9feca336f05 diff --git a/src/wrapper/connection_handle.cxx b/src/wrapper/connection_handle.cxx index 40943054..f9a33d8f 100644 --- a/src/wrapper/connection_handle.cxx +++ b/src/wrapper/connection_handle.cxx @@ -44,6 +44,7 @@ #include #include +#include #include #include #include @@ -6015,7 +6016,6 @@ apply_options(couchbase::cluster_options& cluster_options, zval* options) options::assign_string("network", key, value, [&](auto v) { cluster_options.network().preferred_network(v); - cluster_options.behavior().network(v); }); options::assign_string("trustCertificate", key, value, [&](auto v) {