Skip to content

Load config from correct location with static build#746

Open
metsma wants to merge 4 commits into
masterfrom
static
Open

Load config from correct location with static build#746
metsma wants to merge 4 commits into
masterfrom
static

Conversation

@metsma
Copy link
Copy Markdown
Contributor

@metsma metsma commented Jun 1, 2026

IB-8961

Related: #723

Signed-off-by: Raul Metsma raul@metsma.ee

lnagel and others added 3 commits June 1, 2026 10:35
When BUILD_SHARED_LIBS=OFF on Windows, DIGIDOCPP_EXPORT in Exports.h
defaults to __declspec(dllimport), which is incorrect for both compiling
the library and for consumers linking the static archive.

Add a digidocpp_STATIC check in Exports.h that sets DIGIDOCPP_EXPORT to
empty. Define digidocpp_STATIC as a PUBLIC compile definition on
digidocpp, digidocpp_tsl, and digidocpp_util so downstream consumers
also get the correct (empty) export macro.

Also remove the duplicate static targets install, already covered by
the install(TARGETS ...) export set, and fix if(NOT ...) style.
Replace the unconditional digidocpp_EXPORTS on digidocpp_tsl and
digidocpp_util with a generator expression that selects digidocpp_EXPORTS
for shared builds and digidocpp_STATIC for static builds. This avoids
having both defines set simultaneously.
Signed-off-by: Raul Metsma <raul@metsma.ee>
IB-8961

Signed-off-by: Raul Metsma <raul@metsma.ee>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants