Skip to content

Commit

Permalink
linking libsqlite3 instead of compiling amalgamation
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiosvm committed Sep 6, 2023
1 parent 9c6342d commit 1fbc0c0
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 254,533 deletions.
2 changes: 1 addition & 1 deletion BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Hook's project brings some extensions (non-core built-in modules) that are not c
To build the extensions, you need to install some dependencies:

```
sudo apt-get install -y libcurl4-openssl-dev libhiredis-dev libmysqlclient-dev
sudo apt-get install -y libsqlite3-dev libcurl4-openssl-dev libmysqlclient-dev libgmp3-dev libzmq3-dev libleveldb-dev libpcre3-dev
```

So you can build the extensions with the following command:
Expand Down
9 changes: 6 additions & 3 deletions disabled-workflows/build-with-extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ jobs:
- name: Installing dependencies (APT packages)
run: |
sudo apt-get update -y
sudo apt-get install -y libsqlite3-dev
sudo apt-get install -y libcurl4-openssl-dev
sudo apt-get install -y libmysqlclient-dev
sudo apt-get install -y libgmp3-dev
sudo apt-get install libzmq3-dev
sudo apt-get install libleveldb-dev
sudo apt-get install libpcre3-dev
sudo apt-get install -y libzmq3-dev
sudo apt-get install -y libleveldb-dev
sudo apt-get install -y libpcre3-dev
- name: Installing dependency hiredis
run: |
git clone https://github.com/redis/hiredis.git
Expand Down Expand Up @@ -64,6 +65,7 @@ jobs:
- uses: actions/checkout@v2
- name: Installing dependencies (Homebrew packages)
run: |
brew install sqlite
brew install openssl
brew install fcgi
brew install mysql-client
Expand Down Expand Up @@ -105,6 +107,7 @@ jobs:
vcpkg integrate install
- name: Installing dependencies (vcpkg packages)
run: |
vcpkg install sqlite3:x64-windows
vcpgk install openssl:x64-windows
vcpkg install curl:x64-windows
vcpkg install fastcgi:x64-windows
Expand Down
9 changes: 6 additions & 3 deletions disabled-workflows/release-with-extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ jobs:
- name: Installing dependencies (APT packages)
run: |
sudo apt-get update -y
sudo apt-get install -y libsqlite3-dev
sudo apt-get install -y libcurl4-openssl-dev
sudo apt-get install -y libmysqlclient-dev
sudo apt-get install -y libgmp3-dev
sudo apt-get install libzmq3-dev
sudo apt-get install libleveldb-dev
sudo apt-get install libpcre3-dev
sudo apt-get install -y libzmq3-dev
sudo apt-get install -y libleveldb-dev
sudo apt-get install -y libpcre3-dev
- name: Installing dependency hiredis
run: |
git clone https://github.com/redis/hiredis.git
Expand Down Expand Up @@ -54,6 +55,7 @@ jobs:
- uses: actions/checkout@v2
- name: Installing dependencies (Homebrew packages)
run: |
brew install sqlite
brew install openssl
brew install fcgi
brew install mysql-client
Expand Down Expand Up @@ -93,6 +95,7 @@ jobs:
vcpkg integrate install
- name: Installing dependencies (vcpkg packages)
run: |
vcpkg install sqlite3:x64-windows
vcpgk install openssl:x64-windows
vcpkg install curl:x64-windows
vcpkg install fastcgi:x64-windows
Expand Down
6 changes: 4 additions & 2 deletions extensions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if(NOT MSVC)
endif()

if(MSVC)
find_package(SQLite3 CONFIG REQUIRED)
find_package(CURL CONFIG REQUIRED)
find_package(libmysql REQUIRED)
endif()
Expand Down Expand Up @@ -49,8 +50,7 @@ if(APPLE)
endif()

add_library(sqlite_mod SHARED
sqlite.c
deps/sqlite3.c)
sqlite.c)

add_library(curl_mod SHARED
curl.c)
Expand Down Expand Up @@ -109,6 +109,7 @@ set_target_properties(crypto_mod PROPERTIES PREFIX "")
set_target_properties(regex_mod PROPERTIES PREFIX "")

if(MSVC)
target_link_libraries(sqlite_mod PRIVATE SQLite::SQLite3)
target_link_libraries(curl_mod PRIVATE CURL::libcurl)
target_link_libraries(mysql_mod PRIVATE ${MYSQL_LIBRARIES})
target_link_libraries(zeromq_mod PRIVATE ${ZEROMQ_LIBRARIES})
Expand All @@ -118,6 +119,7 @@ if(MSVC)
endif()

if(NOT MSVC)
target_link_libraries(sqlite_mod sqlite3)
target_link_libraries(curl_mod curl)
target_link_libraries(mysql_mod mysqlclient)
target_link_libraries(zeromq_mod zmq)
Expand Down
Loading

0 comments on commit 1fbc0c0

Please sign in to comment.