Skip to content

Commit

Permalink
Use cmake on CI to generate FTL binaries.
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <dl6er@dl6er.de>
  • Loading branch information
DL6ER committed May 26, 2020
1 parent c2a163b commit 8aa6099
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
7 changes: 3 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ version: 2
- run:
name: "Setup"
command: |
make clean
if [[ $CIRCLE_JOB == *"qemu"* ]] ; then sudo docker run --rm --privileged multiarch/qemu-user-static:register --reset ; fi
- run:
name: "Build"
no_output_timeout: 30m
command: |
BRANCH=$([ -z "$CIRCLE_TAG" ] && echo "$CIRCLE_BRANCH" || echo "master")
[[ $CIRCLE_JOB == *"qemu"* ]] && DOCKERIFNEEDED="docker run --rm -v $(pwd):/workspace -w /workspace pihole/ftl-build:arm-qemu "
$DOCKERIFNEEDED make GIT_BRANCH="${BRANCH}" GIT_TAG="${CIRCLE_TAG}" STATIC="${STATIC}"
file pihole-FTL
$DOCKERIFNEEDED mkdir cmake && cd cmake && cmake -DSTATIC="${STATIC}" .. && cmake --build . -- GIT_BRANCH="${BRANCH}" GIT_TAG="${CIRCLE_TAG}" CIRCLE_JOB="${CIRCLE_JOB}" -j 2
mv pihole-FTL ../
- run:
name: "Binary checks"
command: bash test/arch_test.sh
Expand All @@ -38,7 +37,7 @@ version: 2
.docker_template: &docker_template
docker:
- image: pihole/ftl-build:v1.2-$CIRCLE_JOB
- image: pihole/ftl-build:v1.3-$CIRCLE_JOB
<<: *job_steps

jobs:
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ add_executable(pihole-FTL
if(STATIC STREQUAL "true")
set_target_properties(pihole-FTL PROPERTIES LINK_SEARCH_START_STATIC ON)
set_target_properties(pihole-FTL PROPERTIES LINK_SEARCH_END_STATIC ON)
target_link_libraries(pihole-FTL -static-libgcc -static)
target_link_libraries(pihole-FTL -static-libgcc -static -static-pie)
endif()
target_compile_options(pihole-FTL PRIVATE ${EXTRAWARN})
target_include_directories(pihole-FTL PRIVATE ${PROJECT_SOURCE_DIR}/src)
Expand Down
11 changes: 8 additions & 3 deletions src/gen_version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ if(NOT DEFINED GIT_TAG)
endif()

# If CIRCLE_JOB is unset (local compilation), ask uname -m and add locally compiled comment
if(DEFINED CIRCLE_JOB)
set(FTL_ARCH "${CIRCLE_JOB} (compiled on CI)")
if(DEFINED ENV{CIRCLE_JOB})
set(FTL_ARCH "$ENV{CIRCLE_JOB} (compiled on CI)")
else()
execute_process(
COMMAND uname -m
Expand All @@ -79,7 +79,12 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)

message("Making FTL version on branch ${GIT_BRANCH} - ${GIT_VERSION} / ${GIT_TAG} / ${GIT_HASH} (${GIT_DATE})")
message("Compiling Pi-hole FTL daemon")
message(" Branch: ${GIT_BRANCH}")
message(" Architecture: ${FTL_ARCH}")
message(" Version: ${GIT_VERSION}")
message(" Tag/Hash: ${GIT_TAG} / ${GIT_HASH}")
message(" Commit date: ${GIT_DATE}")

# configure the version file, but output to a temporary location
configure_file(
Expand Down

0 comments on commit 8aa6099

Please sign in to comment.