Skip to content

Cmake improvements#275

Merged
slouken merged 3 commits intolibsdl-org:mainfrom
madebr:cmake-improvements
May 30, 2022
Merged

Cmake improvements#275
slouken merged 3 commits intolibsdl-org:mainfrom
madebr:cmake-improvements

Conversation

@madebr
Copy link
Copy Markdown
Contributor

@madebr madebr commented May 30, 2022

  • Name static library, when built with MSVC or Watcom (targeting Windows or OS/2), SD2_image-static.
    This avoids a clash between the dll import library and the static library.
  • Only apply 'compatible Interface Properties' when building a shared SDL2_image library.
    This avoids using a static SDL2 and shared SDL2_image together.
  • Install the cmake config files in a cmake subfolder.
    This should fix CMake build on Windows installs package config in non-standard directory #274

@slouken slouken merged commit 8c12e4e into libsdl-org:main May 30, 2022
@madebr madebr deleted the cmake-improvements branch May 30, 2022 15:08
FtZPetruska added a commit to FtZPetruska/SDL_net that referenced this pull request May 30, 2022
- Set a different output name for static libraries on MSVC and WATCOM (cf. libsdl-org/SDL_image#275 and libsdl-org/SDL#5727)
- Fix `PKG_PREFIX` on Windows (cf. libsdl-org/SDL_image#274)

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
madebr added a commit to libsdl-org/SDL_net that referenced this pull request Jun 14, 2022
#48

* Add CMake support.

Implementation is based off SDL2_Image.

* Add CMake tests to test-versioning.sh.

* Add CMake workflow

Changes link flags to fix mingw builds.

`showinterfaces` is disabled on MSVC workflow as the minimum version of SDL is too old for current MSVCRT and gives linker errors even when linking `legacy_stdio_definitions.lib`

* Apply suggestion from review

Only set `Compatible Interface Properties` for shared libraries.

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* CMake: Define SDL_MAIN_HANDLED for showinterfaces.

This removes the need for SDL2main as it is a console-only application.
MSVC workflow now builds showinterfaces.

* Apply suggestion from review.

The `mingw32` library is no longer needed as `showinterfaces` is a console app.

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* CMake: Update MSVC compiler flags.

Applied review suggestion to use `target_compile_options`.
Replaced `/wd4996` as `_WINSOCK_DEPRECATED_NO_WARNINGS` is enough.
Raise the warning level to `/W3` to be consistent with the solution in
`VisualC/`.

* Apply suggestions from code review.

- Set a different output name for static libraries on MSVC and WATCOM (cf. libsdl-org/SDL_image#275 and libsdl-org/SDL#5727)
- Fix `PKG_PREFIX` on Windows (cf. libsdl-org/SDL_image#274)

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* CMake: Fix missing parenthesis.

* CMake: Remove dead code.

SDL_net does not build any dependency, so we don't need to force
position independent code.

* CMake: Add config files for XCode Frameworks

* CMake: Generate cmake config when using autotools.

* CMake: Add config files for mingw devel archive.

* CMake: Add config files for VC devel archive.

* Regenerate autotools file with CMake support.

* autogen.sh + cmake integration test

* Don't force an installed SDL2_net::SDL2_net-static to link with a specific SDL2 sharedness library

* Update PrivateSdlFunctions.cmake

* Apply suggestion from review.

Fix option de-duplication issues when linking with SDL2 framework.

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* CMake: Escape framework parent path.

This is necessary if the framework has a space in its path.

* Apply suggestion from review.

Fix name mismatch between the bundled CMake config file for mingw and the generated config.

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* Apply suggestion from review.

Fix regex match.

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

* Apply suggestion from review.

No longer set PKG_PREFIX on macOS.

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
Co-authored-by: Anonymous Maarten <anonymous.maarten@gmail.com>
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.

CMake build on Windows installs package config in non-standard directory

2 participants