Skip to content

Commit ae7230f

Browse files
committed
Feature select: no crytpo.cpp and no override of encryption_utils in Wasm
1 parent 4548495 commit ae7230f

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ add_extension_definitions()
99
include_directories(extension/httpfs/include
1010
${DUCKDB_MODULE_BASE_DIR}/third_party/httplib)
1111

12+
if (NOT EMSCRIPTEN)
13+
set(EXTRA_SOURCES "extension/httpfs/crypto.cpp")
14+
add_definitions(-DOVERRIDE_ENCRYPTION_UTILS=1)
15+
endif()
16+
1217
build_static_extension(
1318
httpfs
1419
extension/httpfs/hffs.cpp
@@ -19,7 +24,8 @@ build_static_extension(
1924
extension/httpfs/crypto.cpp
2025
extension/httpfs/hash_functions.cpp
2126
extension/httpfs/create_secret_functions.cpp
22-
extension/httpfs/httpfs_extension.cpp)
27+
extension/httpfs/httpfs_extension.cpp
28+
${EXTRA_SOURCES})
2329

2430
set(PARAMETERS "-warnings")
2531
build_loadable_extension(
@@ -33,7 +39,8 @@ build_loadable_extension(
3339
extension/httpfs/crypto.cpp
3440
extension/httpfs/hash_functions.cpp
3541
extension/httpfs/create_secret_functions.cpp
36-
extension/httpfs/httpfs_extension.cpp)
42+
extension/httpfs/httpfs_extension.cpp
43+
${EXTRA_SOURCES})
3744

3845
if(MINGW)
3946
set(OPENSSL_USE_STATIC_LIBS TRUE)

extension/httpfs/httpfs_extension.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
#include "duckdb.hpp"
77
#include "s3fs.hpp"
88
#include "hffs.hpp"
9+
#ifdef OVERRIDE_ENCRYPTION_UTILS
910
#include "crypto.hpp"
11+
#endif // OVERRIDE_ENCRYPTION_UTILS
1012

1113
namespace duckdb {
1214

@@ -74,8 +76,10 @@ static void LoadInternal(DatabaseInstance &instance) {
7476
CreateS3SecretFunctions::Register(instance);
7577
CreateBearerTokenFunctions::Register(instance);
7678

79+
#ifdef OVERRIDE_ENCRYPTION_UTILS
7780
// set pointer to OpenSSL encryption state
7881
config.encryption_util = make_shared_ptr<AESStateSSLFactory>();
82+
#endif // OVERRIDE_ENCRYPTION_UTILS
7983
}
8084
void HttpfsExtension::Load(DuckDB &db) {
8185
LoadInternal(*db.instance);

0 commit comments

Comments
 (0)