Skip to content

Commit

Permalink
sigh i hate windwos
Browse files Browse the repository at this point in the history
  • Loading branch information
anchpop committed Aug 16, 2024
1 parent b1361cb commit c11eb09
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ jobs:
- name: Install dependencies (macOS)
if: matrix.os == 'macos-latest'
run: |
brew install cmake ninja glew glfw openal-soft
brew install cmake ninja glew glfw3 openal-soft
- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
choco install cmake ninja glfw3 openal
choco install cmake ninja openal
- name: Configure CMake
run: |
Expand Down
15 changes: 10 additions & 5 deletions OpenGL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ file(GLOB_RECURSE header_files "src/*.h")
find_package(OpenGL REQUIRED)

## GLFW
find_package(PkgConfig REQUIRED)
pkg_check_modules(GLFW REQUIRED glfw3)
if(WIN32)
set(GLFW_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/OpenGL/Dependencies/GLFW/include")
set(GLFW_LIBRARY "${CMAKE_SOURCE_DIR}/OpenGL/Dependencies/GLFW/lib-vc2022/glfw3.lib")
else()
find_package(PkgConfig REQUIRED)
pkg_check_modules(GLFW REQUIRED glfw3)
endif()

## OpenAL
find_package(OpenAL REQUIRED)
Expand All @@ -25,23 +30,23 @@ add_executable(${PROJECT_NAME} ${cpp_files} ${header_files})

target_include_directories(${PROJECT_NAME} PRIVATE
${OPENAL_INCLUDE_DIR}
${GLFW_INCLUDE_DIRS}
${GLFW_INCLUDE_DIR}
${GLEW_INCLUDE_DIR}
${OPENGL_INCLUDE_DIRS}
Dependencies/OpenAL/include
)

if(WIN32)
target_link_libraries(${PROJECT_NAME}
-L${GLFW_LIBDIR} ${GLFW_LIBRARIES}
${GLFW_LIBRARY}
${GLEW_LIBRARY}
${OPENGL_LIBRARIES}
${OPENAL_LIBRARY}
)
target_compile_definitions(${PROJECT_NAME} PRIVATE GLEW_STATIC)
else()
target_link_libraries(${PROJECT_NAME}
-L${GLFW_LIBDIR} ${GLFW_LIBRARIES}
${GLFW_LIBRARIES}
GLEW::GLEW
${OPENGL_LIBRARIES}
${OPENAL_LIBRARY}
Expand Down

0 comments on commit c11eb09

Please sign in to comment.