# This is a generated file, please do not modify. It is generated by
# timelib_get_sources.sh

Import('env')

env = env.Clone()

try:
    env.AppendUnique(CCFLAGS=[
        '-DHAVE_GETTIMEOFDAY',
        '-DHAVE_STRING_H',
    ])
    if env.TargetOSIs('windows'):
        env.AppendUnique(CCFLAGS=[
            '-DHAVE_IO_H',
            '-DHAVE_WINSOCK2_H',
        ])

        env.Append(CCFLAGS=[
            '/wd4067',  # C4067: '...': expected a newline
            '/wd4996',  # C4996: '...': was declared deprecated
        ])
    elif env.TargetOSIs('solaris'):
        env.AppendUnique(CCFLAGS=[
            '-DHAVE_DIRENT_H',
            '-DHAVE_STRINGS_H',
            '-DHAVE_UNISTD_H',
            '-D_POSIX_C_SOURCE=200112L',
        ])
    elif env.TargetOSIs('darwin'):
        env.AppendUnique(CCFLAGS=[
            '-DHAVE_DIRENT_H',
            '-DHAVE_SYS_TIME_H',
            '-DHAVE_UNISTD_H',
        ])
    else:
        env.AppendUnique(CCFLAGS=[
            '-DHAVE_DIRENT_H',
            '-DHAVE_SYS_TIME_H',
            '-DHAVE_UNISTD_H',
            '-D_GNU_SOURCE',
        ])
except ValueError:
    pass

env.Library(
    target='timelib',
    source=[
        'dist/astro.c',
        'dist/dow.c',
        'dist/interval.c',
        'dist/parse_date.c',
        'dist/parse_iso_intervals.c',
        'dist/parse_tz.c',
        'dist/parse_posix.c',
        'dist/parse_zoneinfo.c',
        'dist/timelib.c',
        'dist/tm2unixtime.c',
        'dist/unixtime2tm.c',
    ],
    LIBDEPS_TAGS=[
        'init-no-global-side-effects',
    ],
)
