Skip to content

cmake windows shared builds do not export symbols #72

@sigmoidal

Description

@sigmoidal

When building shared libs on windows, using cmake and -DBUILD_SHARED_LIBS=On, no .lib file is produced, which in turn doesn't allow a consumer to link against cctz.

Ideally, symbols should be properly exported (see https://msdn.microsoft.com/en-us/library/a90k134d.aspx), then a lib file will be generated.

A not-so-elegant, but working solution may be to enable: CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS, which I had success with, however for optimal results you should only export what should be exported.

This workaround is as simple as adding:

set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS YES CACHE BOOL "Export all symbols")

or running the cmake config command with -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=True

thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions