-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add xmake build definition and enable ci (#228)
- Loading branch information
Showing
3 changed files
with
87 additions
and
1 deletion.
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 |
---|---|---|
@@ -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 | ||
|
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 |
---|---|---|
|
@@ -58,4 +58,8 @@ jpeg-8d | |
Downloads | ||
|
||
# notes etc. | ||
etc | ||
etc | ||
|
||
#xmake unwanted# | ||
################ | ||
.xmake |
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,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 | ||
|