Skip to content

Conversation

@ZzzhHe
Copy link

@ZzzhHe ZzzhHe commented Dec 1, 2023

Description:

This pull request addresses the build issue encountered when compiling the SDL2 project on macOS, specifically for users who have installed SDL2 via Homebrew brew install sdl2

fixes #22

Changes made:

  1. Modified CMakeLists.txt to detect if the build is happening on macOS and if SDL2 is installed via Homebrew.
  2. Added conditional statements to set the SDL2_INCLUDE_DIR and SDL2_LIB_DIR variables to the appropriate paths used by Homebrew.
  3. Adjusted the target_link_libraries command to ensure proper linking against the SDL2 library.

The changes ensure compatibility with the standard SDL2 installation method as well as with Homebrew's path structure, providing a more seamless build experience for macOS users.

Testing:

  • The build was tested on macOS with SDL2 installed via Homebrew, confirming that the issue is resolved.
  • Ensured that the build process remains unaffected on other operating systems.

@ZzzhHe ZzzhHe requested a review from a team as a code owner December 1, 2023 20:16
@ZzzhHe ZzzhHe requested review from SudKul and removed request for a team December 1, 2023 20:16
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.

Compile on M1 Mac

1 participant