mirror of
https://github.com/tbamud/tbamud.git
synced 2025-09-21 21:40:49 +02:00
Added new easy way of building TbaMUD in the Visual Studio through the CMake (#127)
* Added new experimental MSVC build way through CMake * Small build/README.md fix
This commit is contained in:
parent
498b652546
commit
b2d38522e0
5 changed files with 50 additions and 0 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -10,3 +10,6 @@ src/util/Makefile
|
||||||
src/.accepted
|
src/.accepted
|
||||||
src/depend
|
src/depend
|
||||||
src/util/depend
|
src/util/depend
|
||||||
|
build/*
|
||||||
|
!build/create_solution.bat
|
||||||
|
!build/README.md
|
15
build/README.md
Normal file
15
build/README.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
### Overview
|
||||||
|
This guide describes how to build TbaMUD in the Visual Studio through the new experimental CMake environment.
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
* [Visual Studio 2022+](https://visualstudio.microsoft.com/ru/vs/)
|
||||||
|
* [CMake 3.27+](https://cmake.org/)
|
||||||
|
|
||||||
|
### Build Steps
|
||||||
|
1. Goto the folder `src` and copy `conf.h.win` to `conf.h`.
|
||||||
|
|
||||||
|
2. Goto the folder `build` and execute `create_solution.bat`.
|
||||||
|
|
||||||
|
3. Open `build/circle.sln` in Visual Studio.
|
||||||
|
|
||||||
|
4. Compile and run.
|
1
build/create_solution.bat
Normal file
1
build/create_solution.bat
Normal file
|
@ -0,0 +1 @@
|
||||||
|
cmake -B . -S ..\src -G "Visual Studio 17 2022"
|
26
src/CMakeLists.txt
Normal file
26
src/CMakeLists.txt
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
cmake_minimum_required(VERSION 3.27)
|
||||||
|
|
||||||
|
# Set the project name
|
||||||
|
project(circle)
|
||||||
|
|
||||||
|
# Global definitions
|
||||||
|
if(MSVC)
|
||||||
|
# using Visual Studio C++
|
||||||
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# circle itself
|
||||||
|
file(GLOB CIRCLE_SOURCES
|
||||||
|
"*.h"
|
||||||
|
"*.c"
|
||||||
|
)
|
||||||
|
|
||||||
|
add_executable(circle ${CIRCLE_SOURCES})
|
||||||
|
|
||||||
|
if(MSVC)
|
||||||
|
target_link_libraries(circle wsock32.lib)
|
||||||
|
|
||||||
|
set_target_properties(circle PROPERTIES
|
||||||
|
VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/.."
|
||||||
|
)
|
||||||
|
endif()
|
|
@ -13,6 +13,11 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#include "telnet.h"
|
||||||
|
#define alloca _alloca
|
||||||
|
#endif
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
The following section is for Diku/Merc derivatives. Replace as needed.
|
The following section is for Diku/Merc derivatives. Replace as needed.
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue