Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add examples to SDL.sln #11255

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Conversation

Susko3
Copy link
Contributor

@Susko3 Susko3 commented Oct 18, 2024

Description

Each C example from the examples/ directory is added as a Visual C++ project to SDL.sln, making it easy to test and see the examples on Windows. The projects include the .c file and README.txt. To avoid code duplication in .vcxproj files, common code is moved to Directory.Build.props.

The project files can be automatically generated with the provided generate.py python file, but they still need to be manually added to the appropriate place in the VS solution (using Add existing project).

The initial project files were made with JetBrains Rider and not Visual Studio, but they do work in VS. There might be slight differences if you compare with the test projects.

image

Existing Issue(s)

@slouken
Copy link
Collaborator

slouken commented Oct 18, 2024

This seems reasonable to me, @icculus?

@slouken slouken added this to the 3.2.0 milestone Oct 18, 2024
@slouken slouken requested a review from icculus October 18, 2024 00:25
@madebr
Copy link
Contributor

madebr commented Oct 18, 2024

I'm curious whether the examples rebuild when switching between Configuration (Release|Debug)and Platform (Win32|x64).

@Susko3
Copy link
Contributor Author

Susko3 commented Oct 18, 2024

It does rebuild, both the example and the main SDL project.

For some reason, the examples don't work when I build Win32. Runtime error about SDL3.dll missing. The tests work fine /shrug.

@madebr
Copy link
Contributor

madebr commented Oct 18, 2024

This looks fine to me as a first version.

Directory.Build.props is a user-defined file that provides customizations to projects under a directory

Our vcxproj projects contain a lot of repeated code. Perhaps we should add all common code in a shared .props.
I did such a thing in #7257 (for the wrong reason).
The only thing we lose with such change is easy modification of target options in the Visual Studio IDE.

@icculus
Copy link
Collaborator

icculus commented Oct 18, 2024

I'm not against this, but we're absolutely going to forget to add new programs over time.

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.

[Feature request] Add examples to SDL.sln (visual studio solutions)
4 participants