[openjpeg] 16645 Fix compile w/features jp3d,jpip,jpwl,mj2 triplet x64-windows VS 2019 ver 16.9.1 (#16661)

* Fix for openjpeg issue 16645 compile with VS2019 16.9.1
- Modified portfile.cmake to apply patch
  fix-lrintf-to-opj_lrintf.patch
- Added patch to change /src/lib/openmj2/opj_includes.h
  From: static INLINE long lrintf(float f)
  To:   static INLINE long opj_lrintf(float f)
- Converted CONTROL file to vcpkg.json file
- Fix was tested locally on triplet x64-windows with
  Microsoft Windows x64 Professional 20H2 [Version 10.0.19042.867]
    Windows Feature Experience Pack 120.2212.551.0
  Windows SDK [Version 10.0.19041.0]
  VS 2017:
    Visual Studio 2017 Community Edition [Version 15.9.34]
    Visual Studio Toolset [Version 14.16.27023]
    Microsoft (R) C/C++ Optimizing Compiler [Version 19.16.27045 for x64]
  VS 2019:
    Visual Studio 2019 Community Edition [Version 16.9.1]
    Visual Studio Toolset [Version 14.28.29910]
    Microsoft (R) C/C++ Optimizing Compiler [Version 19.28.29912 for x64]

* Update json file

* Reformat vcpkg.json file

* Update port version

* Update json file

* Update ports/openjpeg/portfile.cmake

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

* Update ports/openjpeg/vcpkg.json

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

* Update versions/baseline.json

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

* Update versions/o-/openjpeg.json

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

* Update json file

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>
This commit is contained in:
General Jack O'Neill 2021-03-15 18:21:09 -04:00 committed by GitHub
parent b6b16270d2
commit 5f3249e50e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 43 additions and 19 deletions

View File

@ -1,17 +0,0 @@
Source: openjpeg
Version: 2.3.1
Port-Version: 2
Homepage: https://github.com/uclouvain/openjpeg
Description: JPEG 2000 image library
Feature: jpwl
Description: Build optional component jpwl
Feature: mj2
Description: Build optional component mj2
Feature: jpip
Description: Build optional component jpip
Feature: jp3d
Description: Build optional component jp3d

View File

@ -0,0 +1,13 @@
diff --git a/src/lib/openmj2/opj_includes.h b/src/lib/openmj2/opj_includes.h
index 340e8a9..11bb0e4 100644
--- a/src/lib/openmj2/opj_includes.h
+++ b/src/lib/openmj2/opj_includes.h
@@ -93,7 +93,7 @@ Most compilers implement their own version of this keyword ...
/* MSVC and Borland C do not have lrintf */
#if defined(_MSC_VER) || defined(__BORLANDC__)
-static INLINE long lrintf(float f)
+static INLINE long opj_lrintf(float f)
{
#ifdef _M_X64
return (long)((f > 0.0f) ? (f + 0.5f) : (f - 0.5f));

View File

@ -4,7 +4,9 @@ vcpkg_from_github(
REF v2.3.1 REF v2.3.1
SHA512 339fbc899bddf2393d214df71ed5d6070a3a76b933b1e75576c8a0ae9dfcc4adec40bdc544f599e4b8d0bc173e4e9e7352408497b5b3c9356985605830c26c03 SHA512 339fbc899bddf2393d214df71ed5d6070a3a76b933b1e75576c8a0ae9dfcc4adec40bdc544f599e4b8d0bc173e4e9e7352408497b5b3c9356985605830c26c03
HEAD_REF master HEAD_REF master
PATCHES dll.location.patch PATCHES
dll.location.patch
fix-lrintf-to-opj_lrintf.patch
) )
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")

21
ports/openjpeg/vcpkg.json Normal file
View File

@ -0,0 +1,21 @@
{
"name": "openjpeg",
"version-semver": "2.3.1",
"port-version": 3,
"description": "OpenJPEG is an open-source JPEG 2000 codec written in C language. It has been developed in order to promote the use of JPEG 2000, a still-image compression standard from the Joint Photographic Experts Group (JPEG). Since April 2015, it is officially recognized by ISO/IEC and ITU-T as a JPEG 2000 Reference Software.",
"homepage": "https://github.com/uclouvain/openjpeg",
"features": {
"jp3d": {
"description": "Build optional component jp3d"
},
"jpip": {
"description": "Build optional component jpip"
},
"jpwl": {
"description": "Build optional component jpwl"
},
"mj2": {
"description": "Build optional component mj2"
}
}
}

View File

@ -4358,7 +4358,7 @@
}, },
"openjpeg": { "openjpeg": {
"baseline": "2.3.1", "baseline": "2.3.1",
"port-version": 2 "port-version": 3
}, },
"openmama": { "openmama": {
"baseline": "6.3.1", "baseline": "6.3.1",

View File

@ -1,5 +1,10 @@
{ {
"versions": [ "versions": [
{
"git-tree": "55220d839365c2134574acc4e9b43b8adc2e20ab",
"version-semver": "2.3.1",
"port-version": 3
},
{ {
"git-tree": "06e54db04d7adacfd612bbaf233f6f790599b9c1", "git-tree": "06e54db04d7adacfd612bbaf233f6f790599b9c1",
"version-string": "2.3.1", "version-string": "2.3.1",