Skip to content

Commit

Permalink
Add xmake build definition and enable ci (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
da-liii authored Oct 11, 2023
1 parent f33f094 commit 8753bab
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/ci-xmake-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build on linux

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
linuxbuild:
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y gcc cmake
# Force xmake to a specific folder (for cache)
- name: Set xmake global dir
run: |
echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/.xmake-global" >> "${{ github.env }}"
- uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: v2.8.3
- name: update repo
run: xmake repo -u
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: cache xmake
uses: actions/cache@v2
with:
path: |
${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
${{ github.workspace }}/build/.build_cache
key: ${{ runner.os }}-xmake-${{ hashFiles('**/xmake.lua') }}
# Force xmake to a specific folder (for cache)
- name: config
run: xmake config --yes -vD
- name: build
run: xmake build --yes -vD

6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,8 @@ jpeg-8d
Downloads

# notes etc.
etc
etc

#xmake unwanted#
################
.xmake
40 changes: 40 additions & 0 deletions xmake.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
-- originally from https://github.com/xmake-io/xmake-repo/pull/1709

option("libtiff", {description = "Enable libtiff", default = false})
option("libpng", {description = "Enable libpng", default = false})
option("libjpeg", {description = "Enable libjpeg", default = false})
add_rules("mode.debug", "mode.release")
if has_config("libtiff") then
add_requires("libtiff")
end
if has_config("libpng") then
add_requires("libpng")
end
if has_config("libjpeg") then
add_requires("libjpeg")
end
add_requires("freetype", "zlib", "libaesgm")
target("pdfhummus")
set_kind("$(kind)")
add_files("PDFWriter/*.cpp")
add_headerfiles("(PDFWriter/*.h)")
add_packages("freetype")
add_packages("libtiff", "libpng", "libjpeg")
add_packages("libaesgm", "zlib")
if has_package("libtiff") then
add_defines("_INCLUDE_TIFF_HEADER")
add_cxflags("-Wno-deprecated-declarations")
else
add_defines("PDFHUMMUS_NO_TIFF=1")
end
if not has_package("libpng") then
add_defines("PDFHUMMUS_NO_PNG=1")
end
if not has_package("libjpeg") then
add_defines("PDFHUMMUS_NO_DCT=1")
end
-- port symbols for linker
if is_plat("windows") and is_kind("shared") then
add_rules("utils.symbols.export_all", {export_classes = true})
end

0 comments on commit 8753bab

Please sign in to comment.