Skip to content

Commit 20e333a

Browse files
authored
[Fix] remove semicolon (#118)
* [Fix] remove semicolon * [Build] builds now on windows, program doesnt work * [Fix] add missing semicolon * [Fix] path
1 parent 1ab1779 commit 20e333a

File tree

9 files changed

+25
-17
lines changed

9 files changed

+25
-17
lines changed

Diff for: .github/workflows/build_windows.yml

+10-7
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,22 @@ jobs:
2020
- name: create-conan-profile
2121
shell: powershell
2222
# Generates default profile detecting GCC and sets old ABI
23-
run: conan profile new default --detect;
23+
run: >
24+
conan profile new default --detect;
25+
conan profile update conf.tools.system.package_manager:mode=install default;
26+
conan profile update conf.tools.system.package_manager:sudo=True default;
27+
2428
2529
# Build project
2630
- name: build
2731
shell: powershell
2832
run: >
29-
conan profile update conf.tools.system.package_manager:mode=install default;
30-
conan profile update conf.tools.system.package_manager:sudo=True default;
31-
mkdir build;
32-
make build;
33+
conan install conanfile.txt -if build --build=missing;
34+
cmake -S . -B build;
35+
cmake --build build;
3336
3437
- name: verify-files
3538
shell: bash
3639
run: >
37-
rm ./bin/Client;
38-
rm ./bin/Server;
40+
rm ./build/bin/Client;
41+
rm ./build/bin/Server;

Diff for: CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
88
if (MSVC)
99
set (CMAKE_GENERATOR "Visual Studio 17" CACHE INTERNAL "" FORCE)
1010
add_compile_definitions(WIN32_LEAN_AND_MEAN)
11+
add_compile_definitions(-D_WIN32_WINNT=0x0601)
1112
else()
1213
set (CMAKE_GENERATOR "Unix Makefiles" CACHE INTERNAL "" FORCE)
1314
add_compile_options(-g3)

Diff for: Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ BUILD = build
44

55
build: normdir conan
66
cmake -S . -B $(BUILD);
7-
cmake --build $(BUILD)
7+
cmake --build $(BUILD);
88

99
test: testdir conan
1010
cmake -S . -B $(BUILD) -DTESTMODE=1;
@@ -21,7 +21,7 @@ normdir:
2121
$(eval BUILD="build")
2222

2323
conan:
24-
conan install conanfile.txt -if $(BUILD) --build=missing;
24+
conan install conanfile.txt -if $(BUILD) --build=missing
2525

2626
cleanbuild: normdir clean
2727

Diff for: README.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,13 @@ $ cmake --build . --config Release
6363
Delete the build folder if present:
6464

6565
```
66-
$ Remove-Item 'build' -Recurse
66+
rmdir /s build
6767
```
6868

6969
Then build the binaries:
7070

7171
```
72-
$ New-item -itemtype directory build
73-
$ Set-Location build
74-
$ conan install . --build=missing
75-
$ cmake .. -G "Visual Studio 17"
76-
$ cmake --build . --config Release
72+
conan install conanfile.txt -if build --build=missing
73+
cmake -S . -B build
74+
cmake --build build
7775
```

Diff for: src/WindowsGuard.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ typedef struct tagBITMAPINFOHEADER {
6767
DWORD biClrImportant;
6868
} BITMAPINFOHEADER, *PBITMAPINFOHEADER;
6969

70+
7071
#include <mmreg.h>
7172
#include <mmsystem.h>
7273
#include <objbase.h>

Diff for: src/client/Protocols/ClientGameProtocol.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
** .
66
*/
77

8+
9+
#include "../../WindowsGuard.hpp"
10+
811
#include "ClientGameProtocol.hpp"
912
#include "../../shared/Utilities/Utilities.hpp"
1013

Diff for: src/server/Systems/Factory.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ EntityID Factory::Enemy::makeEnemy(std::shared_ptr<ECSManager> ECS) {
7171
const float startX = WINDOW_WIDTH;
7272
const float startY = rand() % (int)WINDOW_HEIGHT;
7373

74-
Position::Component* position = ECS->addComp<Position::Component>(enemy, {x : startX, y : startY});
74+
Position::Component* position = ECS->addComp<Position::Component>(enemy, {startX, startY});
7575
Animation::Component* animation = ECS->addComp<Animation::Component>(enemy, {Animation::AnimationID::Orb, 3});
7676

7777
ECS->addComp<Velocity::Component>(enemy, {-10, 0});

Diff for: src/shared/Networking/UdpCommunication.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ void UdpCommunication::setup_incoming_handler() {
7878
// Reset buffer
7979
memset(this->_buffer, 0, 1024);
8080

81-
std::cerr << "Error performing async_receive_from()" << std::endl;
81+
std::cerr << "Error performing async_receive_from()" << err << std::endl;
8282
this->setup_incoming_handler();
8383
}
8484
});

Diff for: src/shared/Utilities/Utilities.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#endif
2020
#endif
2121

22+
#include "../../WindowsGuard.hpp"
23+
2224
#define ERROR(msg) std::cout << REDL << "[ERROR] " << __FUNCTION_NAME__ << ": " << msg << NC << std::endl
2325
#define WARNING(msg) std::cout << "[WARNING] " << __FUNCTION_NAME__ << ": " << msg << std::endl
2426
#define LOG(msg) std::cout << "[LOG] " << __FUNCTION_NAME__ << ": " << msg << std::endl

0 commit comments

Comments
 (0)