Skip to content

Commit

Permalink
27.0.12077973
Browse files Browse the repository at this point in the history
  • Loading branch information
yujincheng08 committed Jul 17, 2024
1 parent a4c34ad commit 4ba72ef
Show file tree
Hide file tree
Showing 1,599 changed files with 317,296 additions and 302 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Maven

on:
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Build with Gradle
run: ./gradlew :cxx:publish
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.maven_pgp_signingKey }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.maven_pgp_signingPassword }}
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.maven_ossrhUsername }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.maven_ossrhPassword }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
.externalNativeBuild
.cxx
local.properties
.idea
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
[submodule "cxx-source"]
path = cxx-source
url = [email protected]:topjohnwu/libcxx.git
branch = master
61 changes: 0 additions & 61 deletions build.gradle

This file was deleted.

10 changes: 10 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
plugins {
alias(libs.plugins.lsplugin.publish)
}

val androidTargetSdkVersion by extra(35)
val androidMinSdkVersion by extra(21)
val androidBuildToolsVersion by extra("35.0.0")
val androidCompileSdkVersion by extra(35)
val androidNdkVersion by extra("27.0.12077973")
val androidCmakeVersion by extra("3.28.0+")
1 change: 0 additions & 1 deletion cxx-source
Submodule cxx-source deleted from b74fd5
78 changes: 0 additions & 78 deletions cxx/build.gradle

This file was deleted.

111 changes: 111 additions & 0 deletions cxx/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
plugins {
alias(libs.plugins.agp.lib)
alias(libs.plugins.lsplugin.jgit)
alias(libs.plugins.lsplugin.publish)
alias(libs.plugins.lsplugin.cmaker)
`maven-publish`
signing
}

val androidTargetSdkVersion: Int by rootProject.extra
val androidMinSdkVersion: Int by rootProject.extra
val androidBuildToolsVersion: String by rootProject.extra
val androidCompileSdkVersion: Int by rootProject.extra
val androidNdkVersion: String by rootProject.extra
val androidCmakeVersion: String by rootProject.extra


android {
compileSdk = androidCompileSdkVersion
ndkVersion = androidNdkVersion
buildToolsVersion = androidBuildToolsVersion

buildFeatures {
buildConfig = false
prefabPublishing = true
androidResources = false
prefab = true
}

packaging {
jniLibs {
excludes += "**.so"
}
}

prefab {
register("cxx") {
headers = "jni/libcxx/include"
}
}

defaultConfig {
minSdk = androidMinSdkVersion
}

lint {
abortOnError = true
checkReleaseBuilds = false
}

externalNativeBuild {
cmake {
path = file("jni/CMakeLists.txt")
version = androidCmakeVersion
}
}
namespace = "org.lsposed.libcxx"

publishing {
singleVariant("release") {
withSourcesJar()
withJavadocJar()
}
}
}

cmaker {
default {
abiFilters("armeabi-v7a", "arm64-v8a", "x86", "x86_64", "riscv64")
arguments += "-DANDROID_STL=none"
arguments += "-DCMAKE_VERBOSE_MAKEFILE=ON"
}
buildTypes {

}
}

publish {
githubRepo = "LSPosed/prefab-libcxx"
publications {
register<MavenPublication>("libcxx") {
artifactId = "libcxx"
afterEvaluate {
from(components.getByName("release"))
}
group = "org.lsposed.libcxx"
version = androidNdkVersion
pom {
name.set("libcxx")
description.set("libcxx")
url.set("https://github.com/LSPosed/prefab-libcxx")
licenses {
license {
name.set("Apache v2.0")
url.set("https://github.com/llvm/llvm-project/blob/main/LICENSE.TXT")
}
}
developers {
developer {
name.set("LLVM")
url.set("https://llvm.org/")
}
}
scm {
connection.set("scm:git:https://github.com/LSPosed/prefab-libcxx.git")
url.set("https://github.com/LSPosed/prefab-libcxx")
}
}
}
}
}
3 changes: 0 additions & 3 deletions cxx/jni/Android.mk

This file was deleted.

6 changes: 0 additions & 6 deletions cxx/jni/Application.mk

This file was deleted.

60 changes: 60 additions & 0 deletions cxx/jni/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
cmake_minimum_required(VERSION 3.22.1)

project(cxx)

set(CMAKE_CXX_STANDARD 23)

file(GLOB LIBCXX_SOURCES "libcxx/src/*.cpp" "libcxx/src/filesystem/*.cpp")

list(FILTER LIBCXX_SOURCES EXCLUDE REGEX ".*/(tzdb_list|tz|locale|ios|iostream|ostream|fstream|regex|ios.instantiations|strstream)\.cpp$")

message(STATUS "LIBCXX_SOURCES: ${LIBCXX_SOURCES}")

set(LIBCXX_EXPORT_FLAGS
-DLIBCXX_BUILDING_LIBCXXABI
-D_LIBCPP_HAS_NO_EXCEPTIONS
-D_LIBCPP_NO_RTTI
-D_LIBCPP_BUILDING_LIBRARY
-D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS
-D_LIBCXXABI_NO_EXCEPTIONS
-D_LIBCPP_HAS_NO_LOCALIZATION
)
set(LIBCXX_FLAGS
-fvisibility-global-new-delete-hidden
-fvisibility=hidden
-fvisibility-inlines-hidden
)
set(LIBCXX_EXPORT_INCLUDES libcxx/include)
set(LIBCXX_INCLUDES libcxx/src)

set(LIBCXXABI_SOURCES
abort_message.cpp
cxa_aux_runtime.cpp
cxa_default_handlers.cpp
cxa_exception_storage.cpp
cxa_guard.cpp
cxa_handlers.cpp
cxa_noexception.cpp
cxa_thread_atexit.cpp
cxa_vector.cpp
cxa_virtual.cpp
stdlib_exception.cpp
stdlib_new_delete.cpp
stdlib_stdexcept.cpp
stdlib_typeinfo.cpp
)
list(TRANSFORM LIBCXXABI_SOURCES PREPEND libcxxabi/src/)
set(LIBCXXABI_FLAGS
-Wno-macro-redefined
-Wno-unknown-attributes
-DHAS_THREAD_LOCAL)
set(LIBCXXABI_INCLUDES libcxxabi/include)

add_library(cxx STATIC ${LIBCXX_SOURCES} ${LIBCXXABI_SOURCES})
target_compile_options(cxx PUBLIC ${LIBCXX_EXPORT_FLAGS})
target_compile_options(cxx PRIVATE ${LIBCXX_FLAGS} ${LIBCXXABI_FLAGS} -ffunction-sections -fdata-sections)
target_include_directories(cxx PUBLIC ${LIBCXX_EXPORT_INCLUDES})
target_include_directories(cxx PRIVATE ${LIBCXX_INCLUDES} ${LIBCXXABI_INCLUDES})

target_compile_options(cxx PRIVATE -flto)
target_link_options(cxx PRIVATE -flto)
Loading

0 comments on commit 4ba72ef

Please sign in to comment.