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

cmake: Require OpenGL for clients only #261

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,18 @@ set(BUILD_GENKEY ON CACHE STRING "Build genkey")
# this allows for easier cross-compiling with MinGW, as we can use the precompiled libraries
find_package(ZLIB REQUIRED)

# OpenGL may be imported with pkg-config on Unix, but that doesn't work on macOS
set(OpenGL_GL_PREFERENCE LEGACY)

# for SDL2* we need to ship custom configs
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
if(BUILD_CLIENT)
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_mixer REQUIRED)
find_package(OpenGL REQUIRED)
endif()

# OpenGL may be imported with pkg-config on Unix, but that doesn't work on macOS
set(OpenGL_GL_PREFERENCE LEGACY)
find_package(OpenGL REQUIRED)

# import enet
# note that we have to include this before setting CMAKE_EXECUTABLE_SUFFIX
# otherwise, enet's platform tests fail with cryptic error messages
Expand Down