From d5d5b3530d91274f7d548ca534b0802f94b640bb Mon Sep 17 00:00:00 2001 From: Shweet Date: Wed, 31 May 2023 21:31:44 -0400 Subject: [PATCH] windows port, minor fixes --- CMakeLists.txt | 4 ++-- src/engine/glew.h | 4 ++++ src/engine/sdl.h | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a591527..39812c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,11 +32,11 @@ else() set(CMAKE_C_FLAGS "-O2 -Wno-discarded-qualifiers -Wno-pointer-arith -Wno-unused-variable -Wno-unused-parameter -Wall -Wextra -pedantic") endif() -target_link_libraries(${PROJECT_NAME} m GL SDL2::SDL2 SDL2_mixer::SDL2_mixer SDL2_ttf::SDL2_ttf SDL2_image::SDL2_image GLEW::GLEW) +target_link_libraries(${PROJECT_NAME} m SDL2::SDL2 SDL2_mixer::SDL2_mixer SDL2_ttf::SDL2_ttf SDL2_image::SDL2_image GLEW::GLEW) if (WIN32) set(CMAKE_C_FLAGS "-mwindows ${CMAKE_C_FLAGS}") - target_link_libraries(${PROJECT_NAME} mingw32 m GL SDL2::SDL2 SDL2_mixer::SDL2_mixer SDL2_ttf::SDL2_ttf SDL2_image::SDL2_image GLEW::GLEW) + target_link_libraries(${PROJECT_NAME} mingw32 m SDL2::SDL2 SDL2_mixer::SDL2_mixer SDL2_ttf::SDL2_ttf SDL2_image::SDL2_image GLEW::GLEW) endif() message("System: ${CMAKE_SYSTEM_NAME}") diff --git a/src/engine/glew.h b/src/engine/glew.h index b529fc0..872d60c 100644 --- a/src/engine/glew.h +++ b/src/engine/glew.h @@ -5,6 +5,10 @@ #pragma once +#ifdef _WIN32 +#define GLEW_STATIC +#endif + #include void glew_init(void); diff --git a/src/engine/sdl.h b/src/engine/sdl.h index 500fc0d..91a3c6c 100644 --- a/src/engine/sdl.h +++ b/src/engine/sdl.h @@ -5,6 +5,8 @@ #pragma once +#define SDL_MAIN_HANDLED + #include #include #include