DanBloomberg / leptonica

Leptonica is an open source library containing software that is broadly useful for image processing and image analysis applications. The official github repository for Leptonica is: danbloomberg/leptonica. See leptonica.org for more documentation.
Other
1.79k stars 392 forks source link

TARGET_OS_OSX not defined when building conda package #579

Closed izahn closed 3 years ago

izahn commented 3 years ago

I'm working on updating the conda-forge leptionica package over in https://github.com/conda-forge/leptonica-feedstock/pull/25 and I'm getting

utils2.c:2658:7: error: 'TARGET_OS_OSX' is not defined, evaluates to 0 [-Werror,-Wundef-prefix=TARGET_OS_OSX]
  #if TARGET_OS_OSX /* Mac OS X */

(full log available at https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=319549&view=logs&j=58ac6aab-c4bc-5de2-2894-98e408cc8ec9&t=933f325c-924e-533d-4d95-e93b5843ce8b)

It looks like a similar issue was resolved by checking for TARGET_OS_MAC instead of TARGET_OS_OSX over in https://github.com/catchorg/Catch2/pull/2157, maybe the same thing can be done here?

DanBloomberg commented 3 years ago

looks reasonable. Does that fix it for you?

izahn commented 3 years ago

Yes, sorry for not following up here. I did

[[ $(uname) = "Darwin" ]] && sed -i '' 's/TARGET_OS_OSX/TARGET_OS_MAC/g' src/utils2.c

in the conda build, and that does work.

DanBloomberg commented 3 years ago

OK, I'll make the change from catchorg. Thank you for helping with this.

Dan

DanBloomberg commented 3 years ago

Sorry, but we can't do this. It breaks android code, which apparently considers TARGET_OS_MAC to include iOS for some purposes.

izahn commented 3 years ago

OK thanks for the heads up!