Build multiple packet versions on AppVeyor for Windows (#14)

* Move to PowerShell script for Windows build

* Allow CMake to override struct version

* PACKET_VERSION option

* Rename CNPROTO_CUSTOM to CNPROTO_OVERRIDE

Co-authored-by: Raymonf <Raymonf@users.noreply.github.com>
This commit is contained in:
Raymonf
2020-08-21 01:18:19 -04:00
committed by GitHub
parent 24be117e28
commit 0041da795a
3 changed files with 53 additions and 13 deletions

View File

@@ -3,6 +3,13 @@ project(OpenFusion)
set(CMAKE_CXX_STANDARD 17)
# OpenFusion supports multiple packet/struct versions
# 0104 is the default version to build which can be changed
# For example: cmake -B build -DPACKET_VERSION=0728
OPTION(PACKET_VERSION "The packet version to build" "0104")
ADD_DEFINITIONS(-DCNPROTO_OVERRIDE -DCNPROTO_VERSION_${PACKET_VERSION})
# Disallow in-source builds
if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(FATAL_ERROR "In-source builds not allowed. Please refer to the wiki for more information. Please remove the CMakeFiles folder and the CMakeCache.txt file.")
@@ -38,4 +45,4 @@ set_target_properties(openfusion PROPERTIES OUTPUT_NAME ${BIN_NAME})
if (NOT CMAKE_GENERATOR MATCHES "Visual Studio" AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND NOT CMAKE_GENERATOR MATCHES "MinGW Makefiles")
find_package(Threads REQUIRED)
target_link_libraries(openfusion pthread)
endif()
endif()