We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4045 - Inconsistent names for static libraries when built for windows with cmake.
Summary: Inconsistent names for static libraries when built for windows with cmake.
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: build (show other bugs)
Version: 2.0.7
Hardware: x86_64 Windows (All)
: P2 enhancement
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-13 06:50 UTC by hanetzer
Modified: 2018-01-14 14:14 UTC (History)
0 users

See Also:


Attachments
windows cmake enhancements (4.76 KB, patch)
2018-01-13 10:23 UTC, hanetzer
Details | Diff
0001-appveyor.yml-add-basic-ci-for-msvc.patch (667 bytes, patch)
2018-01-14 14:10 UTC, hanetzer
Details | Diff
0002-CMakeLists.txt-sane-name-for-msvc-static-library.patch (1.07 KB, patch)
2018-01-14 14:12 UTC, hanetzer
Details | Diff
0003-appveyor.yml-add-mingw-w64-build.patch (1.78 KB, patch)
2018-01-14 14:12 UTC, hanetzer
Details | Diff
0004-CMakeLists.txt-generate-pkg-config-files-on-mingw.patch (1.81 KB, patch)
2018-01-14 14:13 UTC, hanetzer
Details | Diff
0005-CMakeLists.txt-better-leverage-GNUInstallDirs.patch (2.53 KB, patch)
2018-01-14 14:14 UTC, hanetzer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description hanetzer 2018-01-13 06:50:10 UTC
When building for windows (msvc or mingw-w64) the name of the sdl2 static
library is inconsistent as compared to linux (unsure about osx).

I have prepared a patchset which addresses this issue, but I cannot yet
post emails to discourse. I can attach here, if desired, but in general I
try to avoid having so many logins/accounts.
Comment 1 hanetzer 2018-01-13 10:23:11 UTC
Created attachment 3133 [details]
windows cmake enhancements

changes a few things:

Better leverages GNUInstallDirs to avoid hardcoded directories.

Changes mingw-w64 libraries to libSDL2.dll, libSDL2.dll.a and libSDL2.a
and msvc libraries to SDL2.dll, SDL2.lib, and libSDL2.lib for runtime,
import, and static libraries.

Adds an appveyor.yml for ci integration (may want to look into that),
uses cmake to build
log here: https://ci.appveyor.com/project/hanetzer/sdl/build/2.0.7.28
Comment 2 hanetzer 2018-01-13 10:25:54 UTC
Oh, and it also enables sdl2.pc generation on mingw-w64 targets.
Comment 3 hanetzer 2018-01-14 14:10:31 UTC
Created attachment 3135 [details]
0001-appveyor.yml-add-basic-ci-for-msvc.patch

Optional. Adds msvc appveyor support
Comment 4 hanetzer 2018-01-14 14:12:13 UTC
Created attachment 3136 [details]
0002-CMakeLists.txt-sane-name-for-msvc-static-library.patch

sets library file names to libSDL2.dll, libSDL2.dll.a, and libSDL2.a for
mingw-w64 and SDL2.dll, SDL2.lib, and libSDL2.lib for runtime, import
and static libraries respectively
Comment 5 hanetzer 2018-01-14 14:12:49 UTC
Created attachment 3137 [details]
0003-appveyor.yml-add-mingw-w64-build.patch

Adds appveyor support for mingw-w64 x86_64 builds, optional
Comment 6 hanetzer 2018-01-14 14:13:28 UTC
Created attachment 3138 [details]
0004-CMakeLists.txt-generate-pkg-config-files-on-mingw.patch

Generates pkg-config files for mingw-w64 builds
Comment 7 hanetzer 2018-01-14 14:14:31 UTC
Created attachment 3140 [details]
0005-CMakeLists.txt-better-leverage-GNUInstallDirs.patch

hardcodes less install destinations using GNUInstallDirs