Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CheckSupportSSE2: Fix sse flags unexpected propagation #1721

Merged

Conversation

FantasqueX
Copy link
Contributor

Set function will affects all variables in current directory. If sse flags are added in CheckSupportSSE2.cmake, they will remain in Findminizip-ng.cmake which will cause liblzma cannot be detected. This patch keep CMAKE_REQUIRED_FLAGS being changed only in current file scope. This patch has been tested on riscv64.

Signed-off-by: Letu Ren fantasquex@gmail.com

This patch fixes build error on riscv64. Cmake output is listed below.

-- The CXX compiler identification is GNU 12.2.0
-- The C compiler identification is GNU 12.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Setting build type to 'Release' as none was specified.
-- Setting C++ version to '14' as none was specified.
-- Performing Test COMPILER_SUPPORTS_CXX14
-- Performing Test COMPILER_SUPPORTS_CXX14 - Success
-- Found OpenGL: /usr/lib/libOpenGL.so  found components: OpenGL 
-- Found GLEW: /usr/include (found version "2.2.0") 
-- Found GLUT: TRUE  
-- GLVND supported
-- Performing Test HAVE_SSE2
-- Performing Test HAVE_SSE2 - Failed
-- Disabling SSE optimizations, as the target doesn't support them
-- Setting SOVERSION to '2.2' as none was specified.
-- Found expat: /usr/include (found suitable version "2.5.0", minimum required is "2.4.1") 
-- Found yaml-cpp: /usr/lib/libyaml-cpp.so.0.7.0 (found suitable version "0.7.0", minimum required is "0.7.0") 
-- Found pystring: /usr/include (Required is at least version "1.1.3") 
-- Found Imath: /usr/lib/libImath-3_1.so.29.4.0 (found suitable version "3.1.5", minimum required is "3.0") 
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.13") 
-- Found BZip2: /usr/lib/libbz2.so (found version "1.0.8") 
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - not found
-- Looking for lzma_auto_decoder in /usr/lib/liblzma.so
-- Looking for lzma_auto_decoder in /usr/lib/liblzma.so - not found
-- Looking for lzma_easy_encoder in /usr/lib/liblzma.so
-- Looking for lzma_easy_encoder in /usr/lib/liblzma.so - not found
-- Looking for lzma_lzma_preset in /usr/lib/liblzma.so
-- Looking for lzma_lzma_preset in /usr/lib/liblzma.so - not found
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find LibLZMA (missing: LIBLZMA_HAS_AUTO_DECODER
  LIBLZMA_HAS_EASY_ENCODER LIBLZMA_HAS_LZMA_PRESET) (found version "5.2.7")
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindLibLZMA.cmake:89 (find_package_handle_standard_args)
  /usr/share/cmake/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
  /usr/lib/cmake/minizip-ng/minizip-ng-config.cmake:39 (find_dependency)
  share/cmake/modules/Findminizip-ng.cmake:21 (find_package)
  share/cmake/modules/FindExtPackages.cmake:51 (find_package)
  CMakeLists.txt:261 (include)


-- Configuring incomplete, errors occurred!
See also "/build/opencolorio/src/OpenColorIO-2.2.0/build/CMakeFiles/CMakeOutput.log".
See also "/build/opencolorio/src/OpenColorIO-2.2.0/build/CMakeFiles/CMakeError.log".

CMakeError.log is listed below.

Performing C++ SOURCE FILE Test HAVE_SSE2 failed with the following output:
Change Dir: /build/opencolorio/src/OpenColorIO-2.2.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_7ec19 && [1/2] Building CXX object CMakeFiles/cmTC_7ec19.dir/src.cxx.o
FAILED: CMakeFiles/cmTC_7ec19.dir/src.cxx.o 
/usr/bin/c++ -DHAVE_SSE2  -w -msse2 -std=c++14 -o CMakeFiles/cmTC_7ec19.dir/src.cxx.o -c /build/opencolorio/src/OpenColorIO-2.2.0/build/CMakeFiles/CMakeTmp/src.cxx
c++: error: unrecognized command-line option ‘-msse2’
ninja: build stopped: subcommand failed.


Source file was:

    #include <emmintrin.h>
    int main ()
    {
        __m128d a, b;
        double vals[2] = {0};
        a = _mm_loadu_pd (vals);
        b = _mm_add_pd (a,a);
        _mm_storeu_pd (vals,b);
        return (0);
    }
Determining if the BZ2_bzCompressInit exist failed with the following output:
Change Dir: /build/opencolorio/src/OpenColorIO-2.2.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_24eb7 && [1/2] Building C object CMakeFiles/cmTC_24eb7.dir/CheckSymbolExists.c.o
FAILED: CMakeFiles/cmTC_24eb7.dir/CheckSymbolExists.c.o 
/usr/bin/cc   -w -msse2 -o CMakeFiles/cmTC_24eb7.dir/CheckSymbolExists.c.o -c /build/opencolorio/src/OpenColorIO-2.2.0/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
cc: error: unrecognized command-line option ‘-msse2’
ninja: build stopped: subcommand failed.


File /build/opencolorio/src/OpenColorIO-2.2.0/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <bzlib.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef BZ2_bzCompressInit
  return ((int*)(&BZ2_bzCompressInit))[argc];
#else
  (void)argc;
  return 0;
#endif
}
Determining if the function lzma_auto_decoder exists in the /usr/lib/liblzma.so failed with the following output:
Change Dir: /build/opencolorio/src/OpenColorIO-2.2.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_7167f && [1/2] Building C object CMakeFiles/cmTC_7167f.dir/CheckFunctionExists.c.o
FAILED: CMakeFiles/cmTC_7167f.dir/CheckFunctionExists.c.o 
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=lzma_auto_decoder -w -msse2 -o CMakeFiles/cmTC_7167f.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c
cc: error: unrecognized command-line option ‘-msse2’
ninja: build stopped: subcommand failed.



Determining if the function lzma_easy_encoder exists in the /usr/lib/liblzma.so failed with the following output:
Change Dir: /build/opencolorio/src/OpenColorIO-2.2.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_d1708 && [1/2] Building C object CMakeFiles/cmTC_d1708.dir/CheckFunctionExists.c.o
FAILED: CMakeFiles/cmTC_d1708.dir/CheckFunctionExists.c.o 
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=lzma_easy_encoder -w -msse2 -o CMakeFiles/cmTC_d1708.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c
cc: error: unrecognized command-line option ‘-msse2’
ninja: build stopped: subcommand failed.



Determining if the function lzma_lzma_preset exists in the /usr/lib/liblzma.so failed with the following output:
Change Dir: /build/opencolorio/src/OpenColorIO-2.2.0/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_684ca && [1/2] Building C object CMakeFiles/cmTC_684ca.dir/CheckFunctionExists.c.o
FAILED: CMakeFiles/cmTC_684ca.dir/CheckFunctionExists.c.o 
/usr/bin/cc   -DCHECK_FUNCTION_EXISTS=lzma_lzma_preset -w -msse2 -o CMakeFiles/cmTC_684ca.dir/CheckFunctionExists.c.o -c /usr/share/cmake/Modules/CheckFunctionExists.c
cc: error: unrecognized command-line option ‘-msse2’
ninja: build stopped: subcommand failed.

Set function will affects all variables in current directory. If sse
flags are added in CheckSupportSSE2.cmake, they will remain in
Findminizip-ng.cmake which will cause liblzma cannot be detected. This
patch keep CMAKE_REQUIRED_FLAGS being changed only in current file
scope. This patch has been tested on riscv64.

Signed-off-by: Letu Ren <fantasquex@gmail.com>
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Nov 8, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: FantasqueX / name: FantasqueX (d994e43)

Copy link
Collaborator

@remia remia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch @FantasqueX, thanks for the PR.

@cedrik-fuoco-adsk
Copy link
Contributor

Good fix, thanks for the PR.

@doug-walker doug-walker merged commit b6e40f4 into AcademySoftwareFoundation:main Dec 3, 2022
cedrik-fuoco-adsk pushed a commit that referenced this pull request Jan 5, 2023
Set function will affects all variables in current directory. If sse
flags are added in CheckSupportSSE2.cmake, they will remain in
Findminizip-ng.cmake which will cause liblzma cannot be detected. This
patch keep CMAKE_REQUIRED_FLAGS being changed only in current file
scope. This patch has been tested on riscv64.

Signed-off-by: Letu Ren <fantasquex@gmail.com>

Signed-off-by: Letu Ren <fantasquex@gmail.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit b6e40f4)
cedrik-fuoco-adsk pushed a commit that referenced this pull request Jan 5, 2023
Set function will affects all variables in current directory. If sse
flags are added in CheckSupportSSE2.cmake, they will remain in
Findminizip-ng.cmake which will cause liblzma cannot be detected. This
patch keep CMAKE_REQUIRED_FLAGS being changed only in current file
scope. This patch has been tested on riscv64.

Signed-off-by: Letu Ren <fantasquex@gmail.com>

Signed-off-by: Letu Ren <fantasquex@gmail.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit b6e40f4)
cedrik-fuoco-adsk pushed a commit that referenced this pull request Jan 5, 2023
Set function will affects all variables in current directory. If sse
flags are added in CheckSupportSSE2.cmake, they will remain in
Findminizip-ng.cmake which will cause liblzma cannot be detected. This
patch keep CMAKE_REQUIRED_FLAGS being changed only in current file
scope. This patch has been tested on riscv64.

Signed-off-by: Letu Ren <fantasquex@gmail.com>

Signed-off-by: Letu Ren <fantasquex@gmail.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit b6e40f4)
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
doug-walker added a commit that referenced this pull request Jan 6, 2023
* Changing version release type for 2.2.1 official release.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* replace texture2D function with texture for GLSL 1.3 (#1723)

Signed-off-by: Bart Styczen <bart.styczen@cine.dev>

Signed-off-by: Bart Styczen <bart.styczen@cine.dev>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit d5cedbf)
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* CheckSupportSSE2: Fix sse flags unexpected propagation (#1721)

Set function will affects all variables in current directory. If sse
flags are added in CheckSupportSSE2.cmake, they will remain in
Findminizip-ng.cmake which will cause liblzma cannot be detected. This
patch keep CMAKE_REQUIRED_FLAGS being changed only in current file
scope. This patch has been tested on riscv64.

Signed-off-by: Letu Ren <fantasquex@gmail.com>

Signed-off-by: Letu Ren <fantasquex@gmail.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit b6e40f4)
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Adsk contrib - Fix issue with minizip build (#1725)

* - Refactoring how OCIO search for minizip-ng. The first step is to search for an external minizip-ng. If not found, search for minizip-ng with MZ_COMPAT=ON (libminizip). If it is not found either, download and install minizip-ng with MZ_COMPAT=OFF.
- Removing the minizip-ng part for the includes for minizip-ng headers.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Update comments

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Improved find_package in Config mode (adding it back)
Added missing scripts to install minizip-ng and zlib for the analysis workflow

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Adding +x permissions for install_minizip_ng and zlib
Fixing path to find zlib in install_minizip-ng.sh

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Changing target name to match the one used by minizip-ng library (+ using the imported target instead of creating a new one when minizip-ng is found)

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit 811902b)
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Adsk contrib - Processor cache does not detect changes in cccid (#1726)

* For Looks that has a FileTransform and for Colorspace with FileTransfrom, add the CCCID to the processor's cache key for that transform.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Removing the workaround in the related unit tests and fixing the issue by adding the environment variable to the context using setStringVar. The processor's cache key is using the context cache ID which has all the context variables taken into account.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Now using addStringVars and creating a new context instead of reusing the one used for the filename.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Adding cccid to the context when there are no context variable.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Adding a few unit tests to test that the processor is different when changing the FileTransform's CCCID.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Using setStringVar to set CCNUM context variable in unit test.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Adding a test in FileTransform to test CollectContextVariables directly.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Minor tweaks for the unit test

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit 4fa7750)
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Adsk contrib - Configure the OpenColorIO.pc file on Windows (#1720)

* Configure the OpenColorIO.pc file on Windows and fix an issue where CMAKE_INSTALL_PREFIX wasn't included in the cmake build command in ocio.bat.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Removing pkconfig folder since that PC file is not used.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Small tweak in the configuration of OpenColorIO.cmake.in to handle absolute path with CMAKE_INSTALL_LIBDIR or CMAKE_INSTALL_INCLUDEDIR.
Keeping exec_prefix for CMAKE_INSTALL_INCLUDE_DIR since it was changed for a specific issue on Mac (see PR #1120).

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Using ${prefix} for includedir

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit 332462e)
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Adsk contrib - Hiding minizip-ng symbols on Mac (#1729)

* Hiding minizip-ng symbols on Mac

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Fixing a linking issue related to the code that tries to hide expat symbols and small refactor to add robustness.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit 907ed3b)
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Adsk contrib - Fix issue with is colorspace linear (#1734)

* Throw when the colorspace is undefined for isColorSpaceLinear method. (+ unit test)

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Typo

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit 6d7c479)
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Adsk Contrib - Improve naming of ICC-based displays on Windows (#1742)

* Adding a method to get the Monitor's userFriendlyName if available

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Removing the slashes at the start of the display name

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Adding descriptions and comments.
Adding troubleshooting script that print the monitor display name and ICC profile path.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* no message

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Comments

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit 1d126b5)
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Fix minizip-ng CMake args passing (#1741)

Signed-off-by: Rémi Achard <remiachard@gmail.com>

Signed-off-by: Rémi Achard <remiachard@gmail.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit 051241c)
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Fix inverse Lut1D optimization bug (#1743)

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

Signed-off-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit 5152635)
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Update documentation for 2.2 release (#1738)

* Update documentation for 2.2 release

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Fix typos

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Remove V2_DOC_README.md

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Tweaks to 2.2

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Improve installation section

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Add link to demo config

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Fix typos

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Improve file_rules section

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

Signed-off-by: Doug Walker <doug.walker@autodesk.com>
(cherry picked from commit 17f5c98)
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Adsk Contrib - OCIO cmake improvements (#1736)

* - Refactoring how OCIO search for minizip-ng. The first step is to search for an external minizip-ng. If not found, search for minizip-ng with MZ_COMPAT=ON (libminizip). If it is not found either, download and install minizip-ng with MZ_COMPAT=OFF.
- Removing the minizip-ng part for the includes for minizip-ng headers.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Update comments

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Improved find_package in Config mode (adding it back)
Added missing scripts to install minizip-ng and zlib for the analysis workflow

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Adding +x permissions for install_minizip_ng and zlib
Fixing path to find zlib in install_minizip-ng.sh

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Changing target name to match the one used by minizip-ng library (+ using the imported target instead of creating a new one when minizip-ng is found)

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* First pass for the OpenColorIOConfig.cmake file with the required dependencies only.
A few extra fixes for OpenEXR, ZLIB and Minizip-ng.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Adding a informative message when building static ocio instead of per module.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Adding an extra step to test the consumer app with static OpenColorIO for Windows, Linux and MacOS.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Re-using the same test instead of creating a new one by removing the condition on build-shared.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Fixing spacing, typo and adding back the NOT in the condition. (it was removed for debugging purpose)

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Changing directory where we share OCIO custom find modules (now in <install dir>/share/cmake/modules).
Adding a cmake macro when installing OCIO since it is needed by some custom find modules.
The find modules are only installed when building OCIO as a static library.
The config.cmake.in files now only looks for the dependency when OCIO was built as a static library.
Tentative (ci-workflow): Adding cmake-consumer test for static builds.
Overhaul of the Findzlib module to be more inline with the FindZLIB from cmake and to be more robust.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Adding missing backward slashes and saving the build path in an existing step instead of creating a new step.
Adding a check for CMake version for a section in Findzlib.cmake.
Re-phrasing some comments.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Prevent the download of the dependencies in the scenario where static OCIO is linked to a consumer project. Since OCIO_INSTALL_EXT_PACKAGES is not defined, our find module tries to download the dependencies, but we don't want that mecanism for consumer project.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Changing path where OCIO install its own custom find module.
Removing custom Findzlib and making modifications to use CMake FindZLIB.
Created a InstallZLIB module which does the download and install part if OCIO_INSTALL_EXT_PACAKGES is ALL or MISSING.
Tweaked config.cmake.in to use CMake FindZLIB.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Adding more details in comments

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Removing an extra "shell" property in CI workflow.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Fix issues discovered with the failing CI workflow:

Cmake-consumer test now prefer the static version of the dependencies.
Fix an issue where yaml-cpp is not found by a consumer app (variable spelled incorectly in Findyaml-cpp).
Fix an issue expat library is not found by a consumer app on Windows.
Adding support for OCIO's  <pkg_name>_STATIC_LIBRARY for ZLIB while supporting ZLIB_USE_STATIC_LIBS (CMake 3.24+) from CMake's FindZLIB.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Removing pystring_STATIC_LIBRARY does not exists in CI workflow.
Detecting if the build is Debug in the find module that OCIO installs since they can't rely on variables set by OCIO CMakefiles.
Fix issue with yaml-cpp library naming in debug.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Fix issues on Windows with expat and minizip-ng library naming when building static OCIO.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Added option for macOS CI job in order to get more info on a failed job. Will be reverted once the issue is found.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Fixing a issue on macOS.
Improving ZLIB usage comments.
Bumping minizip-ng to the latest version - 3.0.7.
Bumping ZLIB to the latest version 2.1.13 to fix a vulnerability (CVE-2022-37434)

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Proposing to remove Findminizip module since external minizip-ng build need to be done with the same option as the internal build.
Otherwise, linking and symbols issues are going to happend if the other libraries are not linked in correctly.
It is going to simplify the maintainability of OCIO.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

* Removing findminizip.cmake from the install since it does not exist anymore.

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Cédrik Fuoco <105517825+cedrik-fuoco-adsk@users.noreply.github.com>
(cherry picked from commit 91761f2)
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>

Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Signed-off-by: Bart Styczen <bart.styczen@cine.dev>
Signed-off-by: Letu Ren <fantasquex@gmail.com>
Signed-off-by: Rémi Achard <remiachard@gmail.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Cédrik Fuoco <105517825+cedrik-fuoco-adsk@users.noreply.github.com>
Co-authored-by: bartstyczen <93516126+bartstyczen@users.noreply.github.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
Co-authored-by: FantasqueX <voidren@outlook.com>
Co-authored-by: Rémi Achard <remiachard@gmail.com>
cedrik-fuoco-adsk pushed a commit to autodesk-forks/OpenColorIO that referenced this pull request Mar 24, 2023
…reFoundation#1721)

Set function will affects all variables in current directory. If sse
flags are added in CheckSupportSSE2.cmake, they will remain in
Findminizip-ng.cmake which will cause liblzma cannot be detected. This
patch keep CMAKE_REQUIRED_FLAGS being changed only in current file
scope. This patch has been tested on riscv64.

Signed-off-by: Letu Ren <fantasquex@gmail.com>

Signed-off-by: Letu Ren <fantasquex@gmail.com>
Co-authored-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants