You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So we end up writing our own configuration header like so:
#pragma once
#define USE_OS_TZDB 1
#include "date/date.h"
#include "date/tz.h"
and we tell developers that it is a bug if they include date/tz.h directly in their code and not using our in-tree configuration header.
This also means that the configuration header in-tree needs to be kept in sync with the code that is invoking cmake.
It would be nicer if, for example, the date library cmake would write its own configuration header, e.g. install tz_config.h alongside tz.h. And tz.h would itself include this header, which would contain the defines that we selected at installation time. This is the pattern followed by other common open source libraries like libpng and freetype. And it avoids the possibility of ODR violations and crashes if the installation options and the options in my hand-written header above get out of sync.
Would you guys be interested in a Pull Request that introduces such a configuration header into your cmake?
The text was updated successfully, but these errors were encountered:
Currently, when we install the tz library using cmake, we select a bunch of configuration options, for example:
However, we can't then directly use the headers as is, we also have to add a bunch of defines to the build system, per installation instructions here: https://howardhinnant.github.io/date/tz.html#Installation
So we end up writing our own configuration header like so:
and we tell developers that it is a bug if they include
date/tz.h
directly in their code and not using our in-tree configuration header.This also means that the configuration header in-tree needs to be kept in sync with the code that is invoking cmake.
It would be nicer if, for example, the
date
library cmake would write its own configuration header, e.g. installtz_config.h
alongsidetz.h
. Andtz.h
would itself include this header, which would contain the defines that we selected at installation time. This is the pattern followed by other common open source libraries likelibpng
andfreetype
. And it avoids the possibility of ODR violations and crashes if the installation options and the options in my hand-written header above get out of sync.Would you guys be interested in a Pull Request that introduces such a configuration header into your cmake?
The text was updated successfully, but these errors were encountered: