libjxl

FORK: libjxl patches used on blog
git clone https://git.neptards.moe/blog/libjxl.git
Log | Files | Refs | Submodules | README | LICENSE

lcms2.cmake (2281B)


      1 # Copyright (c) the JPEG XL Project
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
      4 # you may not use this file except in compliance with the License.
      5 # You may obtain a copy of the License at
      6 #
      7 #      http://www.apache.org/licenses/LICENSE-2.0
      8 #
      9 # Unless required by applicable law or agreed to in writing, software
     10 # distributed under the License is distributed on an "AS IS" BASIS,
     11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     14 
     15 add_library(lcms2 STATIC EXCLUDE_FROM_ALL
     16   lcms/src/cmsalpha.c
     17   lcms/src/cmscam02.c
     18   lcms/src/cmscgats.c
     19   lcms/src/cmscnvrt.c
     20   lcms/src/cmserr.c
     21   lcms/src/cmsgamma.c
     22   lcms/src/cmsgmt.c
     23   lcms/src/cmshalf.c
     24   lcms/src/cmsintrp.c
     25   lcms/src/cmsio0.c
     26   lcms/src/cmsio1.c
     27   lcms/src/cmslut.c
     28   lcms/src/cmsmd5.c
     29   lcms/src/cmsmtrx.c
     30   lcms/src/cmsnamed.c
     31   lcms/src/cmsopt.c
     32   lcms/src/cmspack.c
     33   lcms/src/cmspcs.c
     34   lcms/src/cmsplugin.c
     35   lcms/src/cmsps2.c
     36   lcms/src/cmssamp.c
     37   lcms/src/cmssm.c
     38   lcms/src/cmstypes.c
     39   lcms/src/cmsvirt.c
     40   lcms/src/cmswtpnt.c
     41   lcms/src/cmsxform.c
     42   lcms/src/lcms2_internal.h
     43 )
     44 target_include_directories(lcms2
     45     PUBLIC "${CMAKE_CURRENT_LIST_DIR}/lcms/include")
     46 # This warning triggers with gcc-8.
     47 if (CMAKE_C_COMPILER_ID MATCHES "GNU")
     48   target_compile_options(lcms2
     49     PRIVATE
     50       # gcc-only flags.
     51       -Wno-stringop-truncation
     52       -Wno-strict-aliasing
     53   )
     54 endif()
     55 # By default LCMS uses sizeof(void*) for memory alignment, but in arm 32-bits we
     56 # can't access doubles not aligned to 8 bytes. This forces the alignment to 8
     57 # bytes.
     58 target_compile_definitions(lcms2
     59   PRIVATE "-DCMS_PTR_ALIGNMENT=8")
     60 target_compile_definitions(lcms2
     61   PUBLIC "-DCMS_NO_REGISTER_KEYWORD=1")
     62 
     63 # Ensure that a thread safe alternative of gmtime is used in LCMS
     64 include(CheckSymbolExists)
     65 check_symbol_exists(gmtime_r "time.h" HAVE_GMTIME_R)
     66 if (HAVE_GMTIME_R)
     67   target_compile_definitions(lcms2
     68     PUBLIC "-DHAVE_GMTIME_R=1")
     69 else()
     70   check_symbol_exists(gmtime_s "time.h" HAVE_GMTIME_S)
     71   if (HAVE_GMTIME_S)
     72     target_compile_definitions(lcms2
     73       PUBLIC "-DHAVE_GMTIME_S=1")
     74   endif()
     75 endif()
     76 
     77 set_property(TARGET lcms2 PROPERTY POSITION_INDEPENDENT_CODE ON)