Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #10 from ksmit799/master
Browse files Browse the repository at this point in the history
CMake Support
  • Loading branch information
pond3r committed Oct 11, 2019
2 parents 27e5579 + d485558 commit e2b1e47
Show file tree
Hide file tree
Showing 11 changed files with 138 additions and 537 deletions.
46 changes: 33 additions & 13 deletions .gitignore
@@ -1,15 +1,35 @@
# ignore visual studio directies and local files
# Ignore visual studio directies and local files
.vscode
build/VS2019/x64/**
build/VS2019/.vs/**
build/VS2019/Release/**
build/VS2019/Debug/**
build/VS2019/GGPO/Release/**
build/VS2019/GGPO/Debug/**
build/VS2019/GGPO/x64/**
build/VS2019/GGPO/GGPO.vcxproj.user
build/VS2019/Vectorwar/Release/**
build/VS2019/Vectorwar/Debug/**
build/VS2019/Vectorwar/x64/**
build/VS2019/VectorWar/VectorWar.vcxproj.user

# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
68 changes: 68 additions & 0 deletions CMakeLists.txt
@@ -0,0 +1,68 @@
cmake_minimum_required(VERSION 3.2)

# TODO: SDK Versioning.
project(ggpo VERSION 1.0.0)

# What do we want to build?
option(BUILD_GGPO "Enable the build of the GGPO SDK" ON)
option(BUILD_VECTORWAR "Enable the build of the Vector War example app" ON)
option(BUILD_SHARED_LIBS "Enable the build of shared libraries (.dll/.so) instead of static ones (.lib/.a)" ON)

set(GGPO_SDK
src/include/ggponet.h
src/lib/ggpo/main.cpp
src/lib/ggpo/bitvector.h
src/lib/ggpo/bitvector.cpp
src/lib/ggpo/game_input.h
src/lib/ggpo/game_input.cpp
src/lib/ggpo/input_queue.h
src/lib/ggpo/input_queue.cpp
src/lib/ggpo/log.h
src/lib/ggpo/log.cpp
src/lib/ggpo/poll.h
src/lib/ggpo/poll.cpp
src/lib/ggpo/ring_buffer.h
src/lib/ggpo/static_buffer.h
src/lib/ggpo/sync.h
src/lib/ggpo/sync.cpp
src/lib/ggpo/timesync.h
src/lib/ggpo/timesync.cpp
src/lib/ggpo/types.h
src/lib/ggpo/zconf.h
src/lib/ggpo/zlib.h
src/lib/ggpo/backends/backend.h
src/lib/ggpo/backends/p2p.h
src/lib/ggpo/backends/p2p.cpp
src/lib/ggpo/backends/spectator.h
src/lib/ggpo/backends/spectator.cpp
src/lib/ggpo/backends/synctest.h
src/lib/ggpo/backends/synctest.cpp
src/lib/ggpo/network/udp.h
src/lib/ggpo/network/udp.cpp
src/lib/ggpo/network/udp_msg.h
src/lib/ggpo/network/udp_proto.h
src/lib/ggpo/network/udp_proto.cpp
)

if(BUILD_GGPO)
add_library(ggpo ${GGPO_SDK})

target_include_directories(ggpo PUBLIC src/include)
target_include_directories(ggpo PUBLIC src/lib/ggpo)

if(WIN32 AND BUILD_SHARED_LIBS)
# Link to Multimedia API and Winsocks during a static build.
target_link_libraries(ggpo LINK_PUBLIC winmm.lib ws2_32.lib)
endif()

set_target_properties(ggpo PROPERTIES VERSION ${PROJECT_VERSION})
endif()

if(BUILD_VECTORWAR)
# Vector War is windows only.
if(WIN32)
add_subdirectory(src/apps/vectorwar)
else()
message(WARNING "The Vector War app only supports windows, skipping...")
endif()
endif()
11 changes: 10 additions & 1 deletion README.md
Expand Up @@ -5,7 +5,16 @@ Traditional techniques account for network transmission time by adding delay to

For more information about the history of GGPO, check out http://ggpo.net/

This repository contains the code, documentation, and sample application for the Windows version of the SDK (requires Visual Studio 2019).
This repository contains the code, documentation, and sample applications for the SDK.

## Building
Building GGPO is currently only available on Windows, however efforts are being made to port it to other platforms. To get started, clone the repository using either git or svn:
```git clone https://github.com/pond3r/ggpo.git```
**OR**
```svn checkout https://github.com/pond3r/ggpo```

### Windows
On windows, it's recommended to use Visual Studio 2019 and cmake-gui (which can be downloaded [here](https://cmake.org/download/)). Once everything has been setup, open cmake-gui and select the root of the repository under ```Where is the source code:``` followed by the build folder under ```Where to build the binaries:```. Next, hit ```Configure``` and change any options that appear in the main window before hitting ```Generate``` which will generate the VS2019 solution. Once the solution has been generated, hit ```Open Project``` and build with the appropriate settings (Debug/Release). The built binaries can then be found where they were configured to be built.

## Licensing
GGPO is available under The MIT License. This means GGPO is free for commercial and non-commercial use. Attribution is not required, but appreciated.
3 changes: 3 additions & 0 deletions build/.gitignore
@@ -0,0 +1,3 @@
# Track the build directory but not its contents.
*
!.gitignore
44 changes: 0 additions & 44 deletions build/VS2019/GGPO.sln

This file was deleted.

179 changes: 0 additions & 179 deletions build/VS2019/GGPO/GGPO.vcxproj

This file was deleted.

0 comments on commit e2b1e47

Please sign in to comment.