summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarti Maria <marti.maria@littlecms.com>2023-03-06 19:12:57 +0100
committerGitHub <noreply@github.com>2023-03-06 19:12:57 +0100
commit9ca6b591e0af9bebe6412dba907cb077f6291a8c (patch)
tree7f4f9b733915e2ac449348159d14e7001c853344
parent53bc7c5f0251ddcfa5c4e13e2b578b9eb8d75879 (diff)
parent354590d8fb36f6268e39666b7525c6efa1eda5ae (diff)
downloadlcms2-9ca6b591e0af9bebe6412dba907cb077f6291a8c.tar.gz
Merge pull request #365 from amyspark/work/amyspark/add-msys2
Fix MSYS2 compatibility Look great, thank you!
-rw-r--r--.github/workflows/build.yml43
-rw-r--r--meson.build7
-rw-r--r--plugins/threaded/testbed/threaded_testbed.c4
-rw-r--r--src/lcms2.def7
4 files changed, 55 insertions, 6 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 8c4b85a..1590df3 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -2,6 +2,10 @@ name: Build
on: [push, pull_request]
+concurrency:
+ group: ${{ github.workflow }}-${{ github.job }}-${{ github.ref }}
+ cancel-in-progress: true
+
jobs:
Ubuntu:
@@ -14,8 +18,8 @@ jobs:
make
make check
- Ubuntu-18-04:
- runs-on: ubuntu-18.04
+ Ubuntu-20-04:
+ runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Build Ubuntu
@@ -97,3 +101,38 @@ jobs:
meson setup build
meson compile -C build
meson test -C build
+
+ msys-meson:
+ name: 'msys-meson ${{ matrix.sys.abi }} ${{ matrix.library }}'
+ runs-on: windows-latest
+ defaults:
+ run:
+ shell: msys2 {0}
+ strategy:
+ matrix:
+ sys:
+ - { abi: mingw32, env: i686, compiler: gcc }
+ - { abi: mingw64, env: x86_64, compiler: gcc }
+ - { abi: ucrt64, env: ucrt-x86_64, compiler: gcc }
+ - { abi: clang32, env: clang-i686, compiler: clang }
+ - { abi: clang64, env: clang-x86_64, compiler: clang }
+ library: ['shared', 'static']
+ fail-fast: false
+ steps:
+ - name: Use MinGW from MSYS
+ uses: msys2/setup-msys2@v2
+ with:
+ msystem: ${{matrix.sys.abi}}
+ update: true
+ pacboy: >-
+ toolchain:p
+ meson:p
+ ninja:p
+
+ - uses: actions/checkout@v2
+
+ - name: Build Windows
+ run: |
+ meson setup build -Dfastfloat=true -Dthreaded=true -Dsamples=true -Ddefault_library=${{ matrix.library }}
+ meson compile -C build
+ meson test -C build
diff --git a/meson.build b/meson.build
index 694895e..84a164d 100644
--- a/meson.build
+++ b/meson.build
@@ -3,6 +3,7 @@ project(
'c',
version: '2.15',
meson_version: '>=0.49.0',
+ default_options: ['c_std=gnu11']
)
version_components = meson.project_version().split('.')
@@ -33,7 +34,7 @@ endif
# Check for threadsafe variants of gmtime
# MinGW needs _POSIX_C_SOURCE or _POSIX_THREAD_SAFE_FUNCTIONS defined
-# to make gmtime_r available
+# to make gmtime_r and pthread_time.h available
if host_machine.system() == 'windows' and cc.get_argument_syntax() != 'msvc'
cargs += ['-D_POSIX_C_SOURCE=199503L']
endif
@@ -88,6 +89,10 @@ else
cargs += '-DHasTHREADS=0'
endif
+if cc.has_header_symbol('time.h', 'timespec_get')
+ cargs += '-DHAVE_TIMESPEC_GET=1'
+endif
+
win = import('windows')
deps = [m_dep, threads_dep]
diff --git a/plugins/threaded/testbed/threaded_testbed.c b/plugins/threaded/testbed/threaded_testbed.c
index eae94c3..22e52ee 100644
--- a/plugins/threaded/testbed/threaded_testbed.c
+++ b/plugins/threaded/testbed/threaded_testbed.c
@@ -50,7 +50,7 @@ static struct timespec start, finish;
cmsINLINE void MeasureTimeStart(void)
{
-#ifdef CMS_IS_WINDOWS_
+#if defined(HAVE_TIMESPEC_GET)
timespec_get(&start, TIME_UTC);
#else
clock_gettime(CLOCK_MONOTONIC, &start);
@@ -61,7 +61,7 @@ cmsINLINE double MeasureTimeStop(void)
{
double elapsed;
-#ifdef CMS_IS_WINDOWS_
+#if defined(HAVE_TIMESPEC_GET)
timespec_get(&finish, TIME_UTC);
#else
clock_gettime(CLOCK_MONOTONIC, &finish);
diff --git a/src/lcms2.def b/src/lcms2.def
index 9bf2a4f..b9ce630 100644
--- a/src/lcms2.def
+++ b/src/lcms2.def
@@ -364,4 +364,9 @@ cmsMD5finish = cmsMD5finish
_cmsComputeInterpParams = _cmsComputeInterpParams
cmsGetToneCurveParams = cmsGetToneCurveParams
cmsDetectRGBProfileGamma = cmsDetectRGBProfileGamma
-
+_cmsOptimizePipeline = _cmsOptimizePipeline
+_cmsReasonableGridpointsByColorspace = _cmsReasonableGridpointsByColorspace
+_cmsGetTransformFlags = _cmsGetTransformFlags
+_cmsGetTransformWorker = _cmsGetTransformWorker
+_cmsGetTransformMaxWorkers = _cmsGetTransformMaxWorkers
+_cmsGetTransformWorkerFlags = _cmsGetTransformWorkerFlags