Skip to content

Commit 9581e53

Browse files
committed
fix windows build
2 parents e4954b6 + 133e309 commit 9581e53

5 files changed

Lines changed: 12 additions & 14 deletions

File tree

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
[submodule "imgui"]
88
path = libs/imgui
99
url = https://github.com/ocornut/imgui.git
10+
[submodule "libs/SDL"]
11+
path = libs/SDL
12+
url = https://github.com/libsdl-org/SDL.git

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ https://github.com/libsdl-org/SDL_ttf
3434

3535

3636
### Cmake
37-
1. Download dependencies
38-
- [Windows]: Download SDL2 Development Libraries [SDL2-devel-2*.zip]](https://www.libsdl.org/download-2.0.php) end extruct it somewere.
39-
- [Linux]: Install packages `SDL2`, `cmake`, `g++` via package manager.
37+
1. Install packages
38+
- `cmake` to configure and build project
39+
- С/С++ - compiler, for example `g++` or `clang++` / `Visual studio 2022` for Windows.
4040

4141
2. Clone submodules
4242

@@ -51,7 +51,7 @@ $ mkdir build && cd build
5151
```
5252

5353
4. Configure project
54-
- [Windows]: `$ cmake .. -G"Visual Studio 17 2022" -A x64 -DSDL2_LIBRARY="<path_to_SDL2>/lib/x64/SDL2.lib" -DSDL2_INCLUDE_DIR="<path_to_SDL2>/include"`
54+
- [Windows]: `$ cmake .. -G"Visual Studio 17 2022" -A x64`
5555
- [Linux]: `$ cmake ..`
5656

5757
5. Build

Readme(RUS) - ПРОЧТИ МЕНЯ.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ https://github.com/libsdl-org/SDL_ttf
3333
+ Наслаждайтесь!
3434

3535
### Cmake
36-
1. Скачать зависимости
37-
- [Windows]: Скачать SDL2 Development Libraries [SDL2-devel-2*.zip]](https://www.libsdl.org/download-2.0.php) и распаковать в любое место.
38-
- [Linux]: Установить пакеты `SDL2`, `cmake`, `g++` через пакетный менеджер.
36+
1. Установить пакеты
37+
- `cmake` для конфигурирования проекта
38+
- Компилятор С/С++, например `g++` или `clang++` / `Visual studio 2022` для Windows.
3939

4040
2. Склонировать субмодули
4141

@@ -50,7 +50,7 @@ $ mkdir build && cd build
5050
```
5151

5252
4. Сконфигурировать проект
53-
- [Windows]: `$ cmake .. -G"Visual Studio 17 2022" -A x64 -DSDL2_LIBRARY="<path_to_SDL2>/lib/x64/SDL2.lib" -DSDL2_INCLUDE_DIR="<path_to_SDL2>/include"`
53+
- [Windows]: `$ cmake .. -G"Visual Studio 17 2022" -A x64`
5454
- [Linux]: `$ cmake ..`
5555

5656
5. Собрать

libs/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
### options to build SDL ###
32
option(SDL2_DISABLE_INSTALL "" ON)
43
option(SDL2_DISABLE_SDL2MAIN "" ON)
@@ -45,8 +44,6 @@ add_library(imgui_sdl STATIC
4544
imgui_sdl/imgui_sdl.h
4645
)
4746

48-
message(STATUS ${SDL2_INCLUDE_DIRS})
49-
5047
target_link_libraries(imgui_sdl
5148
PUBLIC
5249
SDL2::SDL2-static
@@ -57,4 +54,3 @@ target_include_directories(imgui_sdl
5754
PUBLIC
5855
imgui_sdl
5956
)
60-

source/Main.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44

55
#if defined(_WIN32)
66
#include <windows.h>
7+
#include <string>
78
#else
89
#include <cstdint>
9-
#define _In_
10-
#define _In_opt_
1110
#define ULONGLONG uint64_t
1211
#define strcpy_s(dest, n, src) strncpy(dest, src, n)
1312
#define sprintf_s snprintf

0 commit comments

Comments
 (0)