2021-09-07 08:08:54 +00:00
#
# Options common for the Serenity (target) and Lagom (host) builds
#
2022-11-05 10:37:33 +00:00
# Make relative paths in depfiles be relative to CMAKE_CURRENT_BINARY_DIR rather than to CMAKE_BINARY_DIR
if ( POLICY CMP0116 )
cmake_policy ( SET CMP0116 NEW )
endif ( )
2024-07-20 14:14:39 +00:00
# Enable better flags for configuring swift compilation mode
if ( POLICY CMP0157 )
cmake_policy ( SET CMP0157 NEW )
set ( CMAKE_Swift_COMPILATION_MODE "$<IF:$<CONFIG:Release>,wholemodule,incremental>" )
endif ( )
2021-09-07 08:08:54 +00:00
serenity_option ( ENABLE_COMPILETIME_FORMAT_CHECK ON CACHE BOOL "Enable compiletime format string checks" )
serenity_option ( ENABLE_UNDEFINED_SANITIZER OFF CACHE BOOL "Enable undefined behavior sanitizer testing in gcc/clang" )
2023-08-12 13:39:22 +00:00
serenity_option ( UNDEFINED_BEHAVIOR_IS_FATAL OFF CACHE BOOL "Make undefined behavior sanitizer errors non-recoverable" )
2021-09-07 08:08:54 +00:00
serenity_option ( ENABLE_ALL_THE_DEBUG_MACROS OFF CACHE BOOL "Enable all debug macros to validate they still compile" )
serenity_option ( ENABLE_ALL_DEBUG_FACILITIES OFF CACHE BOOL "Enable all noisy debug symbols and options. Not recommended for normal developer use" )
LibPDF+Meta: Use a CMYK ICC profile to convert CMYK to RGB
CMYK data describes which inks a printer should use to print a color.
If a screen should display a color that's supposed to look similar
to what the printer produces, it results in a color very different
to what Color::from_cmyk() produces. (It's also printer-dependent.)
There are many ICC profiles describing printing processes. It doesn't
matter too much which one we use -- most of them look somewhat
similar, and they all look dramatically better than Color::from_cmyk().
This patch adds a function to download a zip file that Adobe offers
on their web site. They even have a page for redistribution:
https://www.adobe.com/support/downloads/iccprofiles/icc_eula_win_dist.html
(That one leads to a broken download though, so this downloads the
end-user version.)
In case we have to move off this download at some point, there are also
a whole bunch of profiles at https://www.color.org/registry/index.xalter
that "may be used, embedded, exchanged, and shared without restriction".
The adobe zip contains a whole bunch of other useful and fun profiles,
so I went with it.
For now, this only unzips the USWebCoatedSWOP.icc file though, and
installs it in ${CMAKE_BINARY_DIR}/Root/res/icc/Adobe/CMYK/. In
Serenity builds, this will make it to /res/icc/Adobe/CMYK in the
disk image. And in lagom build, after #23016 this is the
lagom res staging directory that tools can install via
Core::ResourceImplementation. `pdf` and `MacPDF` already do that,
`TestPDF` now does it too.
The final piece is that LibPDF then loads the profile from there
and uses it for DeviceCMYK color conversions.
(Doing file access from the bowels of a library is a bit weird,
especially in a system that has sandboxing built in. But LibGfx does
that in FontDatabase too already, and LibPDF uses that, so it's not a
new problem.)
2024-01-31 02:04:37 +00:00
serenity_option ( ENABLE_ADOBE_ICC_PROFILES_DOWNLOAD ON CACHE BOOL "Enable download of Adobe's ICC profiles" )
2021-01-21 20:41:48 +00:00
serenity_option ( ENABLE_COMPILETIME_HEADER_CHECK OFF CACHE BOOL "Enable compiletime check that each library header compiles stand-alone" )
2021-09-07 08:08:54 +00:00
2023-05-31 01:38:52 +00:00
serenity_option ( ENABLE_PUBLIC_SUFFIX_DOWNLOAD ON CACHE BOOL "Enable download of the Public Suffix List at build time" )
2021-09-07 08:08:54 +00:00
serenity_option ( INCLUDE_WASM_SPEC_TESTS OFF CACHE BOOL "Download and include the WebAssembly spec testsuite" )
2022-07-25 11:28:16 +00:00
serenity_option ( INCLUDE_FLAC_SPEC_TESTS OFF CACHE BOOL "Download and include the FLAC spec testsuite" )
2023-03-14 13:12:58 +00:00
serenity_option ( ENABLE_CACERT_DOWNLOAD ON CACHE BOOL "Enable download of cacert.pem at build time" )
2022-01-07 14:31:48 +00:00
2023-08-08 01:13:06 +00:00
serenity_option ( SERENITY_CACHE_DIR "${PROJECT_BINARY_DIR}/../caches" CACHE PATH "Location of shared cache of downloaded files" )
2023-08-10 21:45:59 +00:00
serenity_option ( ENABLE_NETWORK_DOWNLOADS ON CACHE BOOL "Allow downloads of required files. If OFF, required files must already be present in SERENITY_CACHE_DIR" )
2024-04-16 01:50:49 +00:00
serenity_option ( ENABLE_CLANG_PLUGINS OFF CACHE BOOL "Enable building with the Clang plugins" )
2024-05-19 18:31:47 +00:00
serenity_option ( ENABLE_CLANG_PLUGINS_INVALID_FUNCTION_MEMBERS OFF CACHE BOOL "Enable detecting invalid function types as members of GC-allocated objects" )
2024-07-07 15:24:34 +00:00
serenity_option ( ENABLE_GUI_TARGETS ON CACHE BOOL "Enable building GUI targets" )
2024-07-25 00:57:00 +00:00
serenity_option ( ENABLE_INSTALL_HEADERS ON CACHE BOOL "Enable installing headers" )
2024-07-16 11:33:39 +00:00
serenity_option ( ENABLE_SWIFT OFF CACHE BOOL "Enable building Swift files" )
2024-07-20 17:03:24 +00:00
2024-07-25 00:57:00 +00:00
if ( ENABLE_SWIFT )
include ( ${ CMAKE_CURRENT_LIST_DIR } /Swift/swift-settings.cmake )
endif ( )