windows port, minor fixes

This commit is contained in:
Shweet 2023-05-31 21:31:44 -04:00
parent 65c8ca3260
commit d5d5b3530d
3 changed files with 8 additions and 2 deletions

View File

@ -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}")

View File

@ -5,6 +5,10 @@
#pragma once
#ifdef _WIN32
#define GLEW_STATIC
#endif
#include <GL/glew.h>
void glew_init(void);

View File

@ -5,6 +5,8 @@
#pragma once
#define SDL_MAIN_HANDLED
#include <SDL2/SDL.h>
#include <SDL2/SDL_mixer.h>
#include <SDL2/SDL_ttf.h>