-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
There are multiple benefits of using CMake over Autotools like: - CMake is much more modern and requires much less lines of code as compared to doing the same thing in autotools - Autotools is years of bad decisions, generating a long 50k+ lines of bash script to generate the Makefiles definitely isn't a good idea and is really slow as well as makes debugging the build process very difficult - Existing projects using termux-elf-cleaner using CMake should benefit from this.
- Loading branch information
1 parent
eab198c
commit b19916f
Showing
15 changed files
with
119 additions
and
512 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,12 +22,18 @@ jobs: | |
echo "The versionName '${RELEASE_VERSION_NAME/v/}' is not a valid version as per semantic version '2.0.0' spec in the format 'major.minor.patch(-prerelease)(+buildmetadata)'. https://semver.org/spec/v2.0.0.html." | ||
exit 1 | ||
fi | ||
- name: Install required packages | ||
run: | | ||
sudo apt update | ||
sudo apt upgrade | ||
sudo apt install cmake ninja-build | ||
- name: Build | ||
run: | | ||
autoreconf -vfi | ||
mkdir build && cd build | ||
../configure | ||
make | ||
cmake . -Bbuild -GNinja | ||
ninja -C build/ | ||
- name: Test | ||
run: | | ||
ninja -C build/ test | ||
- name: Attach termux-elf-cleaner to release | ||
uses: termux/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
cmake_minimum_required(VERSION 3.25 FATAL_ERROR) | ||
|
||
set(VERSION_MAJOR 3) | ||
set(VERSION_MINOR 0) | ||
set(VERSION_PATCH 0) | ||
|
||
set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") | ||
|
||
set(ARCHES aarch64;arm;i686;x86_64) | ||
set(APIS 21;24) | ||
|
||
project(elf-cleaner | ||
LANGUAGES C CXX | ||
VERSION ${VERSION} | ||
) | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
set(PACKAGE_NAME "termux-elf-cleaner" CACHE STRING "Name of the package") | ||
|
||
add_executable("${PACKAGE_NAME}" | ||
elf-cleaner.cpp | ||
arghandling.c | ||
) | ||
|
||
target_compile_definitions("${PACKAGE_NAME}" | ||
PRIVATE "COPYRIGHT=\"Copyright (C) 2022-2024 Termux and contributors.\"" | ||
PRIVATE "PACKAGE_VERSION=\"${VERSION}\"" | ||
PRIVATE "PACKAGE_NAME=\"${PACKAGE_NAME}\"" | ||
) | ||
|
||
enable_testing() | ||
add_test( | ||
NAME "tests" | ||
COMMAND bash -c "${CMAKE_CURRENT_SOURCE_DIR}/tests/test.sh ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME} ${CMAKE_CURRENT_SOURCE_DIR}" | ||
) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.test |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.