Skip to content
Draft
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
11 changes: 7 additions & 4 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@ jobs:
echo 'org.gradle.configuration-cache=false' >> gradle.properties

- name: 'Build'
env:
CC: zig cc -target x86_64-linux-musl
CXX: zig c++ -target x86_64-linux-musl
run: |
./gradlew :selekt-sqlite3-native:jar
./gradlew clean :selekt-sqlite3-native:jar --no-build-cache --no-configuration-cache --rerun-tasks

- name: 'Upload native JAR'
uses: actions/upload-artifact@v4
with:
name: selekt-native-${{ runner.os }}
path: selekt-sqlite3-native/build/libs/*.jar

ci-pipeline:
name: 'Continuous Integration'
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/publication.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ jobs:

- name: 'Build'
env:
CC: zig cc -target x86_64-linux-musl
CXX: zig c++ -target x86_64-linux-musl
CC: zig cc
CXX: zig c++
CFLAGS: -target x86_64-linux-musl -O2 -s
CXXFLAGS: -target x86_64-linux-musl -O2 -s
run: |
if [[ "${{ github.event_name }}" == "push" ]]; then
./gradlew :selekt-sqlite3-native:jar
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@ local.properties
**/.cxx-host

**/CMakeCache.txt
**/*.cmake
**/CMakeFiles
**/MakeFile
9 changes: 7 additions & 2 deletions SQLite3/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,19 @@ tasks.register<Exec>("cmakeSQLite") {
doFirst {
Files.createDirectories(workingDir)
}
workingDir(".cxx-host")
workingDir(workingDir)
commandLine("cmake")
args(
"-DCMAKE_TOOLCHAIN_FILE=${layout.projectDirectory.dir("zig-toolchain-x86_64-linux-musl.cmake")
.asFile.absolutePath}",
"-DCMAKE_BUILD_TYPE=Release",
"-DUSE_CCACHE=1",
//"-DUSE_CCACHE=1",
"-DSLKT_TARGET_ABI=${platformIdentifier()}",
projectDir
)
isIgnoreExitValue = false
logging.captureStandardOutput(LogLevel.INFO)
logging.captureStandardError(LogLevel.INFO)
}

tasks.register<Exec>("makeSQLite") {
Expand Down
16 changes: 16 additions & 0 deletions SQLite3/zig-toolchain-x86_64-linux-musl.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set(CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_SYSTEM_PROCESSOR "x86_64")

set(CMAKE_C_COMPILER "zig")
set(CMAKE_C_COMPILER_ARG1 "cc")
set(CMAKE_C_COMPILER_TARGET "x86_64-linux-musl")

set(CMAKE_CXX_COMPILER "zig")
set(CMAKE_CXX_COMPILER_ARG1 "c++")
set(CMAKE_CXX_COMPILER_TARGET "x86_64-linux-musl")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O2 -s")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -s")

set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --target=x86_64-linux-musl -s")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
Loading