diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2021-02-21 19:29:13 +0100 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2021-02-21 19:30:23 +0100 |
| commit | 07dfcd0fb79bf953773b7330334449224fa293a1 (patch) | |
| tree | 151e1bd9f7b409ec03b0e8465b3d3a770b533fa7 /jpeg | |
| parent | e387dbd30c81d27e67a33a580578ea846ff25250 (diff) | |
Suppress Visual Studio warnings in bundled libs
We don't have control over the code of these bundled libs, hence we
suppress some special warnings:
- C4267: conversion from ... to ..., possible loss of data
- C4996: The POSIX name for this item is deprecated.
Instead, use the ISO C++ conformant name ...
Diffstat (limited to 'jpeg')
| -rw-r--r-- | jpeg/CMakeLists.txt | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/jpeg/CMakeLists.txt b/jpeg/CMakeLists.txt index a5c27a21e..2e30f2d2e 100644 --- a/jpeg/CMakeLists.txt +++ b/jpeg/CMakeLists.txt @@ -27,18 +27,39 @@ set(decompression_SRCS list(APPEND BUILD_SRCS "${systemdependent_SRCS};${common_SRCS}") list(APPEND BUILD_SRCS "${compression_SRCS};${decompression_SRCS}") + ####################################################################### -FL_ADD_LIBRARY(fltk_jpeg STATIC "${BUILD_SRCS}") -# install the jpeg headers -install(FILES jconfig.h;jerror.h;jmorecfg.h;jpeglib.h - DESTINATION ${FLTK_INCLUDEDIR}/FL/images -) + +# Suppress some Visual Studio compiler warnings +set (msvc_warnings /wd4267) ####################################################################### -if(OPTION_BUILD_SHARED_LIBS) +# Build the static library ####################################################################### -FL_ADD_LIBRARY(fltk_jpeg SHARED "${BUILD_SRCS}") + +FL_ADD_LIBRARY (fltk_jpeg STATIC "${BUILD_SRCS}") + +if (MSVC) + target_compile_options (fltk_jpeg PRIVATE ${msvc_warnings}) +endif (MSVC) ####################################################################### -endif(OPTION_BUILD_SHARED_LIBS) +# Build the shared library (optional) ####################################################################### + +if (OPTION_BUILD_SHARED_LIBS) + FL_ADD_LIBRARY (fltk_jpeg SHARED "${BUILD_SRCS}") + + if (MSVC) + target_compile_options (fltk_jpeg_SHARED PRIVATE ${msvc_warnings}) + endif (MSVC) + +endif (OPTION_BUILD_SHARED_LIBS) + +####################################################################### +# Install the library headers +####################################################################### + +install (FILES jconfig.h jerror.h jmorecfg.h jpeglib.h + DESTINATION ${FLTK_INCLUDEDIR}/FL/images +) |
