Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .devcontainer
Submodule .devcontainer added at 3c2726
30 changes: 30 additions & 0 deletions .github/workflows/xpbuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build
on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]
workflow_dispatch:
jobs:
linux:
uses: externpro/externpro/.github/workflows/build-linux.yml@25.05.1
with:
cmake-workflow-preset: Linux
runon: ubuntu-latest
secrets: inherit
linux-arm64:
uses: externpro/externpro/.github/workflows/build-linux.yml@25.05.1
with:
cmake-workflow-preset: Linux
runon: ubuntu-24.04-arm
secrets: inherit
macos:
uses: externpro/externpro/.github/workflows/build-macos.yml@25.05.1
with:
cmake-workflow-preset: Darwin
secrets: inherit
windows:
uses: externpro/externpro/.github/workflows/build-windows.yml@25.05.1
with:
cmake-workflow-preset: Windows
secrets: inherit
20 changes: 20 additions & 0 deletions .github/workflows/xprelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Release
on:
workflow_dispatch:
inputs:
workflow_run_url:
description: 'URL of the workflow run containing artifacts to upload (e.g., https://github.com/owner/repo/actions/runs/123456789)'
required: true
type: string
jobs:
# Upload build artifacts as release assets
release-from-build:
uses: externpro/externpro/.github/workflows/release-from-build.yml@25.05.1
with:
workflow_run_url: ${{ github.event.inputs.workflow_run_url }}
artifact_pattern: "*.tar.xz"
permissions:
contents: write
id-token: write
attestations: write
secrets: inherit
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# ignore all subdirectories
**/

# track .devcontainer, .github directory, and contents
!.devcontainer
!.github
!.github/*

# externpro
.env
_bld*/
docker-compose.override.yml

# YouCompleteMe
.ycm_extra_conf.*

Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule ".devcontainer"]
path = .devcontainer
url = https://github.com/externpro/externpro
46 changes: 36 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.31)
set(CMAKE_PROJECT_TOP_LEVEL_INCLUDES .devcontainer/cmake/xproinc.cmake)
project(SQLite3
VERSION 3.31.1
VERSION 3.38.2
LANGUAGES C
)

include(GNUInstallDirs)

#------------------------------------------------------------------------------
# externpro
include(xpflags)
set(targetsFile ${PROJECT_NAME}Config)
if(NOT DEFINED XP_NAMESPACE)
set(XP_NAMESPACE SQLite)
set(debugPostfix DEBUG_POSTFIX d)
set(XP_INSTALL_CMAKEDIR cmake)
else()
set(XP_INSTALL_CMAKEDIR ${CMAKE_INSTALL_DATADIR}/cmake)
string(JOIN "\n" EXT1
"set(THREAD_PREFER_PTHREAD_FLAG ON)"
"find_package(Threads REQUIRED) # depends on Threads::Threads"
""
)
xpPackageDevel(TARGETS_FILE ${targetsFile} LIBRARIES ${XP_NAMESPACE}::${PROJECT_NAME})
endif()

#------------------------------------------------------------------------------
# build options and optional modules:
option(SQLITE_ENABLE_COLUMN_METADATA "enables column metadata" OFF)
Expand Down Expand Up @@ -41,7 +60,7 @@ add_library(${PROJECT_NAME} STATIC sqlite3.c)
set_target_properties(${PROJECT_NAME} PROPERTIES
OUTPUT_NAME sqlite3
PUBLIC_HEADER sqlite3.h
DEBUG_POSTFIX d
${debugPostfix}
)
target_include_directories(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
target_compile_definitions(${PROJECT_NAME} PUBLIC # inject user's options
Expand Down Expand Up @@ -88,18 +107,25 @@ elseif(WIN32 AND ${CMAKE_SIZEOF_VOID_P} LESS 8) # this is a 32bit windows
)
endif()
endif()
if(SQLITE_ENABLE_MATH_FUNCTIONS)
include(CheckLibraryExists)
check_library_exists(m sin "m" HAVE_LIBM)
if(HAVE_LIBM)
target_link_libraries(${PROJECT_NAME} PRIVATE m)
endif()
endif()

#------------------------------------------------------------------------------
configure_file(sqlite3_config.h.in ${CMAKE_BINARY_DIR}/sqlite3_config.h)

install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Config
install(TARGETS ${PROJECT_NAME} EXPORT ${targetsFile}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(EXPORT ${PROJECT_NAME}Config
NAMESPACE SQLite::
DESTINATION cmake
install(EXPORT ${targetsFile}
NAMESPACE ${XP_NAMESPACE}::
DESTINATION ${XP_INSTALL_CMAKEDIR}
)
install(FILES
${CMAKE_BINARY_DIR}/sqlite3_config.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
Expand All @@ -115,7 +141,7 @@ if(BUILD_SHELL)
if(UNIX)
if(CMAKE_BUILD_TYPE STREQUAL Release)
add_custom_command(TARGET shell_app POST_BUILD
COMMAND ${CMAKE_STRIP} sqlite3
COMMAND ${CMAKE_STRIP} $<TARGET_FILE:shell_app>
)
endif()
elseif(MSVC)
Expand All @@ -129,7 +155,7 @@ if(BUILD_SHELL)
set(${flag} "${${flag}}" CACHE STRING "msvc flags" FORCE)
endforeach()
endif()
install(TARGETS shell_app
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
install(TARGETS shell_app EXPORT ${targetsFile}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} CONFIGURATIONS Release
)
endif()
8 changes: 8 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"version": 8,
"include": [
".devcontainer/cmake/presets/xpLinuxNinja.json",
".devcontainer/cmake/presets/xpDarwinNinja.json",
".devcontainer/cmake/presets/xpWindowsVs2022.json"
]
}
14 changes: 14 additions & 0 deletions CMakePresetsBase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": 8,
"configurePresets": [
{
"name": "config-base",
"hidden": true,
"binaryDir": "${sourceDir}/_bld-${presetName}",
"cacheVariables": {
"XP_NAMESPACE": "xpro",
"BUILD_SHELL": "ON"
}
}
]
}
1 change: 1 addition & 0 deletions docker-compose.sh
1 change: 1 addition & 0 deletions docker-compose.yml