Merge pull request #5027 from IntelOrca/refactor/vs-static-lib

This merge does several things:
* Changes all the code to be built as a static library, `libopenrct2.lib`
* Adds two new projects to produce `openrct2.dll` and `openrct2.exe`
* Adds a build step to create `openrct2.com`

This is to remove the test configurations and make building the test projects quicker and simpler.
It also distributes two very small shims, `openrct2.exe` and `openrct2.com` which are a GUI windows app and console app respectively. This simplifies the experience of using openrct2 on the command line as .com has higher precedence. `--console` is therefore no longer necessary.

`libopenrct2.lib` will probably be the beginning of several static libraries which make up the game as we will split up the UI from the core logic and possibly more.
This commit is contained in:
Ted John 2017-01-10 20:44:27 +00:00
commit f94daa08df
17 changed files with 538 additions and 356 deletions

View File

@ -24,7 +24,7 @@ set (ORCT2_RESOURCE_DIR ${CMAKE_INSTALL_PREFIX}/share/${PROJECT}/)
project(${PROJECT})
if (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)
message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt")
message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt")
endif()
add_definitions(-DORCT2_RESOURCE_DIR="${ORCT2_RESOURCE_DIR}")
add_definitions(-DHAVE_CONFIG_H)
@ -32,31 +32,31 @@ add_definitions(-DCURL_STATICLIB)
# Define current git branch.
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE OPENRCT2_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE OPENRCT2_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
add_definitions(-DOPENRCT2_BRANCH="${OPENRCT2_BRANCH}")
# Define commit hash.
execute_process(
COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE OPENRCT2_COMMIT_SHA1
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
COMMAND git rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE OPENRCT2_COMMIT_SHA1
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
add_definitions(-DOPENRCT2_COMMIT_SHA1="${OPENRCT2_COMMIT_SHA1}")
# Define short commit hash.
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE OPENRCT2_COMMIT_SHA1_SHORT
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE OPENRCT2_COMMIT_SHA1_SHORT
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
add_definitions(-DOPENRCT2_COMMIT_SHA1_SHORT="${OPENRCT2_COMMIT_SHA1_SHORT}")
@ -99,7 +99,7 @@ INCLUDE(FindPkgConfig)
# Needed for linking with non-broken OpenSSL on Apple platforms
if (APPLE)
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/openssl/lib/pkgconfig")
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/openssl/lib/pkgconfig")
endif (APPLE)
# Options
@ -118,20 +118,20 @@ set(COMMON_COMPILE_OPTIONS "${COMMON_COMPILE_OPTIONS} -fstrict-aliasing -Werror
# On mingw all code is already PIC, this will avoid compiler error on redefining this option
if(NOT MINGW)
set(COMMON_COMPILE_OPTIONS "${COMMON_COMPILE_OPTIONS} -fPIC")
set(COMMON_COMPILE_OPTIONS "${COMMON_COMPILE_OPTIONS} -fPIC")
endif()
if (NOT DISABLE_RCT2)
set (FORCE32 ON)
message("DISABLE_RCT2 implies FORCE32")
set (FORCE32 ON)
message("DISABLE_RCT2 implies FORCE32")
endif()
if (DISABLE_HTTP_TWITCH)
add_definitions(-DDISABLE_HTTP -DDISABLE_TWITCH)
add_definitions(-DDISABLE_HTTP -DDISABLE_TWITCH)
endif (DISABLE_HTTP_TWITCH)
if (DISABLE_TTF)
add_definitions(-DNO_TTF)
add_definitions(-DNO_TTF)
endif (DISABLE_TTF)
# Launchpad turns on -Wdate-time for compilers that support it, this shouldn't break our build
@ -139,58 +139,58 @@ ADD_CHECK_C_COMPILER_FLAG(CMAKE_C_FLAGS C_WARN_WRITE_STRINGS -Wno-error=date-tim
ADD_CHECK_CXX_COMPILER_FLAG(CMAKE_CXX_FLAGS CXX_WARN_WRITE_STRINGS -Wno-error=date-time)
if (FORCE32)
set(TARGET_M "-m32")
set(TARGET_M "-m32")
endif()
if (FORCE32)
set(OBJ_FORMAT "elf32-i386")
set(LINKER_SCRIPT "ld_script_i386.xc")
set(OBJ_FORMAT "elf32-i386")
set(LINKER_SCRIPT "ld_script_i386.xc")
endif ()
if (DISABLE_OPENGL)
add_definitions(-DDISABLE_OPENGL)
add_definitions(-DDISABLE_OPENGL)
else (DISABLE_OPENGL)
# Makes OpenGL function get queried in run-time rather than linked-in
add_definitions(-DOPENGL_NO_LINK)
# Makes OpenGL function get queried in run-time rather than linked-in
add_definitions(-DOPENGL_NO_LINK)
endif (DISABLE_OPENGL)
if (USE_MMAP)
add_definitions(-DUSE_MMAP)
add_definitions(-DUSE_MMAP)
endif (USE_MMAP)
if (DISABLE_NETWORK)
add_definitions(-DDISABLE_NETWORK)
add_definitions(-DDISABLE_NETWORK)
else (DISABLE_NETWORK)
if (WIN32)
SET(NETWORKLIBS ${NETWORKLIBS} ws2_32)
endif (WIN32)
# If you are on macOS, CMake might try using system-provided OpenSSL.
# This is too old and will not work.
PKG_CHECK_MODULES(SSL REQUIRED openssl>=1.0.0)
if (WIN32)
SET(NETWORKLIBS ${NETWORKLIBS} ws2_32)
endif (WIN32)
# If you are on macOS, CMake might try using system-provided OpenSSL.
# This is too old and will not work.
PKG_CHECK_MODULES(SSL REQUIRED openssl>=1.0.0)
endif (DISABLE_NETWORK)
if (DISABLE_RCT2)
add_definitions(-DNO_RCT2)
add_definitions(-DNO_RCT2)
endif (DISABLE_RCT2)
# Start of library checks
PKG_CHECK_MODULES(PNG libpng>=1.6)
if (NOT PNG_FOUND)
PKG_CHECK_MODULES(PNG libpng16)
PKG_CHECK_MODULES(PNG libpng16)
endif (NOT PNG_FOUND)
if (NOT PNG_FOUND)
PKG_CHECK_MODULES(PNG libpng>=1.2)
PKG_CHECK_MODULES(PNG libpng>=1.2)
endif (NOT PNG_FOUND)
if (NOT PNG_FOUND)
PKG_CHECK_MODULES(PNG REQUIRED libpng12)
PKG_CHECK_MODULES(PNG REQUIRED libpng12)
endif (NOT PNG_FOUND)
PKG_CHECK_MODULES(ZLIB REQUIRED zlib)
PKG_CHECK_MODULES(JANSSON REQUIRED jansson>=2.3)
# Handle creating the rct2 text and data files on macOS and Linux
# See details in src/openrct2.c:openrct2_setup_rct2_segment for how the values
# See details in src/openrct2/rct2/interop.c:rct2_interop_setup_segment for how the values
# were derived.
if ((NOT DISABLE_RCT2) AND UNIX)
add_custom_command(
@ -206,40 +206,40 @@ if ((NOT DISABLE_RCT2) AND UNIX)
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/openrct2.exe
)
add_custom_target(segfiles DEPENDS openrct2_text openrct2_data)
if (NOT USE_MMAP)
if (APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -sectcreate rct2_text __text ${CMAKE_CURRENT_SOURCE_DIR}/build/openrct2_text -sectcreate rct2_data __data ${CMAKE_CURRENT_SOURCE_DIR}/build/openrct2_data -segaddr rct2_data 0x8a4000 -segprot rct2_data rwx rwx -segaddr rct2_text 0x401000 -segprot rct2_text rwx rwx -segaddr __TEXT 0x2000000 -read_only_relocs suppress")
else (APPLE)
# For Linux we have to use objcopy to wrap regular binaries into a linkable
# format. We use specific section names which are then referenced in a
# bespoke linker script so they can be placed at predefined VMAs.
add_custom_command(
OUTPUT openrct2_text_section.o
COMMAND objcopy --input binary --output ${OBJ_FORMAT} --binary-architecture i386 openrct2_text openrct2_text_section.o --rename-section .data=.rct2_text,contents,alloc,load,readonly,code
DEPENDS segfiles
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_custom_command(
OUTPUT openrct2_data_section.o
COMMAND objcopy --input binary --output ${OBJ_FORMAT} --binary-architecture i386 openrct2_data openrct2_data_section.o --rename-section .data=.rct2_data,contents,alloc,load,readonly,data
DEPENDS segfiles
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_custom_target(linkable_sections DEPENDS openrct2_text_section.o openrct2_data_section.o)
SET_SOURCE_FILES_PROPERTIES(
openrct2_text_section.o openrct2_data_section.o
PROPERTIES
EXTERNAL_OBJECT true
GENERATED true
)
# can't use GLOB here, as the files don't exist yet at cmake-time
set(RCT2_SECTIONS "${CMAKE_BINARY_DIR}/openrct2_data_section.o" "${CMAKE_BINARY_DIR}/openrct2_text_section.o")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-T,\"${CMAKE_CURRENT_SOURCE_DIR}/distribution/linux/${LINKER_SCRIPT}\"")
endif (APPLE)
endif (NOT USE_MMAP)
if (NOT USE_MMAP)
if (APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -sectcreate rct2_text __text ${CMAKE_CURRENT_SOURCE_DIR}/build/openrct2_text -sectcreate rct2_data __data ${CMAKE_CURRENT_SOURCE_DIR}/build/openrct2_data -segaddr rct2_data 0x8a4000 -segprot rct2_data rwx rwx -segaddr rct2_text 0x401000 -segprot rct2_text rwx rwx -segaddr __TEXT 0x2000000 -read_only_relocs suppress")
else (APPLE)
# For Linux we have to use objcopy to wrap regular binaries into a linkable
# format. We use specific section names which are then referenced in a
# bespoke linker script so they can be placed at predefined VMAs.
add_custom_command(
OUTPUT openrct2_text_section.o
COMMAND objcopy --input binary --output ${OBJ_FORMAT} --binary-architecture i386 openrct2_text openrct2_text_section.o --rename-section .data=.rct2_text,contents,alloc,load,readonly,code
DEPENDS segfiles
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_custom_command(
OUTPUT openrct2_data_section.o
COMMAND objcopy --input binary --output ${OBJ_FORMAT} --binary-architecture i386 openrct2_data openrct2_data_section.o --rename-section .data=.rct2_data,contents,alloc,load,readonly,data
DEPENDS segfiles
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_custom_target(linkable_sections DEPENDS openrct2_text_section.o openrct2_data_section.o)
SET_SOURCE_FILES_PROPERTIES(
openrct2_text_section.o openrct2_data_section.o
PROPERTIES
EXTERNAL_OBJECT true
GENERATED true
)
# can't use GLOB here, as the files don't exist yet at cmake-time
set(RCT2_SECTIONS "${CMAKE_BINARY_DIR}/openrct2_data_section.o" "${CMAKE_BINARY_DIR}/openrct2_text_section.o")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-T,\"${CMAKE_CURRENT_SOURCE_DIR}/distribution/linux/${LINKER_SCRIPT}\"")
endif (APPLE)
endif (NOT USE_MMAP)
elseif (USE_MMAP)
# No dd here, can't extract data segment
message(WARNING "Sorry, your platform is not supported, you have to extract data segment manually")
# No dd here, can't extract data segment
message(WARNING "Sorry, your platform is not supported, you have to extract data segment manually")
endif ((NOT DISABLE_RCT2) AND UNIX)
set(DEBUG_LEVEL 0 CACHE STRING "Select debug level for compilation. Use value in range 03.")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDEBUG=${DEBUG_LEVEL}")
@ -248,17 +248,17 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG=${DEBUG_LEVEL}")
# include lib
include_directories("lib/")
# add source files
file(GLOB_RECURSE ORCT2_SOURCES "src/*.c" "src/*.cpp" "src/*.h" "src/*.hpp")
file(GLOB_RECURSE ORCT2_SOURCES "src/openrct2/*.c" "src/openrct2/*.cpp" "src/openrct2/*.h" "src/openrct2/*.hpp")
if (APPLE)
file(GLOB_RECURSE ORCT2_MM_SOURCES "src/*.m")
set_source_files_properties(${ORCT2_MM_SOURCES} PROPERTIES COMPILE_FLAGS "-x objective-c -fmodules")
file(GLOB_RECURSE ORCT2_MM_SOURCES "src/openrct2/*.m")
set_source_files_properties(${ORCT2_MM_SOURCES} PROPERTIES COMPILE_FLAGS "-x objective-c -fmodules")
endif (APPLE)
if (APPLE AND NOT USE_MMAP)
set(PIE_FLAG "-fno-pie")
set(PIE_FLAG "-fno-pie")
else ()
set(PIE_FLAG "-fpie")
set(PIE_FLAG "-fpie")
endif ()
# set necessary flags to compile code as is
@ -268,78 +268,78 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${TARGET_M}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_SHARED_LINKER_FLAGS} ${PIE_FLAG}")
if (MINGW)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -static-libgcc -static-libstdc++")
endif ()
option(WITH_BREAKPAD "Enable breakpad")
if (WITH_BREAKPAD)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_BREAKPAD")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_BREAKPAD")
set(BREAKPAD_DIR "/home/janisozaur/workspace/breakpad/src")
set(BREAKPAD_INCLUDE_DIR "${BREAKPAD_DIR}/src")
set(BREAKPAD_LIBRARY_DIR "${BREAKPAD_DIR}/src/client/linux")
set(BREAKPAD_LIBS breakpad_client pthread)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_BREAKPAD")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUSE_BREAKPAD")
set(BREAKPAD_DIR "/home/janisozaur/workspace/breakpad/src")
set(BREAKPAD_INCLUDE_DIR "${BREAKPAD_DIR}/src")
set(BREAKPAD_LIBRARY_DIR "${BREAKPAD_DIR}/src/client/linux")
set(BREAKPAD_LIBS breakpad_client pthread)
endif (WITH_BREAKPAD)
PKG_CHECK_MODULES(LIBZIP REQUIRED libzip>=1.0)
# find and include SDL2
PKG_CHECK_MODULES(SDL2 REQUIRED sdl2)
if (NOT DISABLE_TTF)
PKG_CHECK_MODULES(SDL2_TTF REQUIRED SDL2_ttf)
PKG_CHECK_MODULES(SDL2_TTF REQUIRED SDL2_ttf)
endif (NOT DISABLE_TTF)
if (STATIC)
if (NOT DISABLE_TTF)
# FreeType is required by SDL2_ttf, but not wired up properly in package
PKG_CHECK_MODULES(FREETYPE REQUIRED freetype2)
endif (NOT DISABLE_TTF)
SET(SDL2LIBS ${SDL2_STATIC_LIBRARIES} ${SDL2_TTF_STATIC_LIBRARIES} ${FREETYPE_STATIC_LIBRARIES})
if (NOT DISABLE_TTF)
# FreeType is required by SDL2_ttf, but not wired up properly in package
PKG_CHECK_MODULES(FREETYPE REQUIRED freetype2)
endif (NOT DISABLE_TTF)
SET(SDL2LIBS ${SDL2_STATIC_LIBRARIES} ${SDL2_TTF_STATIC_LIBRARIES} ${FREETYPE_STATIC_LIBRARIES})
else (STATIC)
SET(SDL2LIBS ${SDL2_LIBRARIES} ${SDL2_TTF_LIBRARIES})
SET(SDL2LIBS ${SDL2_LIBRARIES} ${SDL2_TTF_LIBRARIES})
endif (STATIC)
if (STATIC)
set(STATIC_START "-static")
SET(REQUIREDLIBS ${PNG_STATIC_LIBRARIES} ${JANSSON_STATIC_LIBRARIES} ${ZLIB_STATIC_LIBRARIES} ${SSL_STATIC_LIBRARIES} ${LIBZIP_STATIC_LIBRARIES})
set(STATIC_START "-static")
SET(REQUIREDLIBS ${PNG_STATIC_LIBRARIES} ${JANSSON_STATIC_LIBRARIES} ${ZLIB_STATIC_LIBRARIES} ${SSL_STATIC_LIBRARIES} ${LIBZIP_STATIC_LIBRARIES})
else (STATIC)
SET(REQUIREDLIBS ${PNG_LIBRARIES} ${JANSSON_LIBRARIES} ${ZLIB_LIBRARIES} ${SSL_LIBRARIES} ${LIBZIP_LIBRARIES})
SET(REQUIREDLIBS ${PNG_LIBRARIES} ${JANSSON_LIBRARIES} ${ZLIB_LIBRARIES} ${SSL_LIBRARIES} ${LIBZIP_LIBRARIES})
endif (STATIC)
if (NOT DISABLE_OPENGL)
if (WIN32)
# Curl depends on openssl and ws2 in mingw builds, but is not wired up in pkg-config
set(GLLIBS opengl32)
# mingw complains about "%zu" not being a valid format specifier for printf, unless we
# tell it that it is
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__USE_MINGW_ANSI_STDIO=1")
elseif (APPLE)
# GL doesn't work nicely with macOS, while find_package doesn't work with multiarch on Ubuntu.
find_package(OpenGL REQUIRED)
set(GLLIBS ${OPENGL_LIBRARY})
else (WIN32)
PKG_CHECK_MODULES(GL REQUIRED gl)
set(GLLIBS ${GL_LIBRARIES})
endif (WIN32)
if (WIN32)
# Curl depends on openssl and ws2 in mingw builds, but is not wired up in pkg-config
set(GLLIBS opengl32)
# mingw complains about "%zu" not being a valid format specifier for printf, unless we
# tell it that it is
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__USE_MINGW_ANSI_STDIO=1")
elseif (APPLE)
# GL doesn't work nicely with macOS, while find_package doesn't work with multiarch on Ubuntu.
find_package(OpenGL REQUIRED)
set(GLLIBS ${OPENGL_LIBRARY})
else (WIN32)
PKG_CHECK_MODULES(GL REQUIRED gl)
set(GLLIBS ${GL_LIBRARIES})
endif (WIN32)
endif (NOT DISABLE_OPENGL)
if (NOT DISABLE_HTTP_TWITCH)
PKG_CHECK_MODULES(LIBCURL REQUIRED libcurl)
if (WIN32)
# Curl depends on openssl and ws2 in mingw builds, but is not wired up in pkg-config
set(WSLIBS ws2_32)
endif (WIN32)
if (STATIC)
SET(HTTPLIBS ${LIBCURL_STATIC_LIBRARIES} ${WSLIBS})
else (STATIC)
SET(HTTPLIBS ${LIBCURL_LIBRARIES} ${WSLIBS})
endif (STATIC)
PKG_CHECK_MODULES(LIBCURL REQUIRED libcurl)
if (WIN32)
# Curl depends on openssl and ws2 in mingw builds, but is not wired up in pkg-config
set(WSLIBS ws2_32)
endif (WIN32)
if (STATIC)
SET(HTTPLIBS ${LIBCURL_STATIC_LIBRARIES} ${WSLIBS})
else (STATIC)
SET(HTTPLIBS ${LIBCURL_LIBRARIES} ${WSLIBS})
endif (STATIC)
endif (NOT DISABLE_HTTP_TWITCH)
PKG_CHECK_MODULES(SPEEX REQUIRED speexdsp)
if (UNIX AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "BSD")
# Include libdl for dlopen
set(DLLIB dl)
# Include libdl for dlopen
set(DLLIB dl)
endif ()
INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS} ${LIBCURL_INCLUDE_DIRS} ${JANSSON_INCLUDE_DIRS} ${SPEEX_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${BREAKPAD_INCLUDE_DIR} ${SSL_INCLUDE_DIRS} ${LIBZIP_INCLUDE_DIRS})
@ -347,39 +347,39 @@ INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS} ${LIBCURL_INCLUDE_DIRS} ${JANSSON_INCLU
LINK_DIRECTORIES(${SDL2_LIBRARY_DIRS} ${JANSSON_LIBRARY_DIRS} ${LIBCURL_LIBRARY_DIRS} ${PNG_LIBRARY_DIRS} ${ZLIB_LIBRARY_DIRS} ${BREAKPAD_LIBRARY_DIR} ${SSL_LIBRARY_DIRS} ${LIBZIP_LIBRARY_DIRS})
if (NOT DISABLE_RCT2)
# Disable optimizations for addresses.c for all compilers, to allow optimized
# builds without need for -fno-omit-frame-pointer
set_source_files_properties(src/addresses.c PROPERTIES COMPILE_FLAGS -O0)
# Disable optimizations for addresses.c for all compilers, to allow optimized
# builds without need for -fno-omit-frame-pointer
set_source_files_properties(src/openrct2/addresses.c PROPERTIES COMPILE_FLAGS -O0)
endif (NOT DISABLE_RCT2)
if (WIN32)
# build as library for now, replace with add_executable
if (USE_MMAP OR DISABLE_RCT2)
add_executable(${PROJECT} ${ORCT2_SOURCES} ${SPEEX_SOURCES})
else ()
add_library(${PROJECT} SHARED ${ORCT2_SOURCES} ${SPEEX_SOURCES})
endif ()
# build as library for now, replace with add_executable
if (USE_MMAP OR DISABLE_RCT2)
add_executable(${PROJECT} ${ORCT2_SOURCES} ${SPEEX_SOURCES})
else ()
add_library(${PROJECT} SHARED ${ORCT2_SOURCES} ${SPEEX_SOURCES})
endif ()
else (WIN32)
add_executable(${PROJECT} ${ORCT2_SOURCES} ${ORCT2_MM_SOURCES} ${RCT2_SECTIONS})
if (NOT DISABLE_RCT2)
add_dependencies(${PROJECT} segfiles)
if (NOT APPLE AND NOT USE_MMAP)
add_dependencies(${PROJECT} linkable_sections)
endif ()
endif (NOT DISABLE_RCT2)
add_custom_command(
OUTPUT g2.dat
COMMAND ./openrct2 sprite build ${CMAKE_BINARY_DIR}/g2.dat ${CMAKE_CURRENT_SOURCE_DIR}/resources/g2/
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_custom_target(g2 DEPENDS ${PROJECT} g2.dat)
add_executable(${PROJECT} ${ORCT2_SOURCES} ${ORCT2_MM_SOURCES} ${RCT2_SECTIONS})
if (NOT DISABLE_RCT2)
add_dependencies(${PROJECT} segfiles)
if (NOT APPLE AND NOT USE_MMAP)
add_dependencies(${PROJECT} linkable_sections)
endif ()
endif (NOT DISABLE_RCT2)
add_custom_command(
OUTPUT g2.dat
COMMAND ./openrct2 sprite build ${CMAKE_BINARY_DIR}/g2.dat ${CMAKE_CURRENT_SOURCE_DIR}/resources/g2/
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
add_custom_target(g2 DEPENDS ${PROJECT} g2.dat)
endif (WIN32)
if (UNIX AND NOT APPLE AND NOT DISABLE_TTF)
# FontConfig for TrueType fonts.
PKG_CHECK_MODULES(FONTCONFIG REQUIRED fontconfig)
INCLUDE_DIRECTORIES(${FONTCONFIG_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(${PROJECT} ${FONTCONFIG_LIBRARIES})
# FontConfig for TrueType fonts.
PKG_CHECK_MODULES(FONTCONFIG REQUIRED fontconfig)
INCLUDE_DIRECTORIES(${FONTCONFIG_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(${PROJECT} ${FONTCONFIG_LIBRARIES})
endif (UNIX AND NOT APPLE AND NOT DISABLE_TTF)
@ -396,8 +396,8 @@ TARGET_LINK_LIBRARIES(${PROJECT} ${GLLIBS})
TARGET_LINK_LIBRARIES(${PROJECT} ${STATIC_START} ${SDL2LIBS} ${HTTPLIBS} ${NETWORKLIBS} ${SPEEX_LIBRARIES} ${DLLIB} ${REQUIREDLIBS} ${BREAKPAD_LIBS})
if (APPLE OR STATIC OR ${CMAKE_SYSTEM_NAME} MATCHES "BSD")
FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
TARGET_LINK_LIBRARIES(${PROJECT} ${ICONV_LIBRARIES})
FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv libiconv-2 c)
TARGET_LINK_LIBRARIES(${PROJECT} ${ICONV_LIBRARIES})
endif ()
# Don't recurse, grab all *.txt and *.md files
@ -424,20 +424,20 @@ install(FILES resources/logo/icon_flag.svg DESTINATION share/icons/hicolor/scala
install(FILES distribution/linux/openrct2.desktop DESTINATION share/applications)
if (WITH_TESTS)
enable_testing()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test/tests/)
enable_testing()
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test/tests/)
endif ()
if (UNIX AND (NOT USE_MMAP) AND (NOT DISABLE_RCT2) AND (FORCE32))
set(OPENRCT2_SRCPATH "src/openrct2")
file(GLOB_RECURSE ORCT2_RIDE_SOURCES "${OPENRCT2_SRCPATH}/ride/*/*.c")
file(GLOB_RECURSE ORCT2_RIDE_DEP_SOURCES "${OPENRCT2_SRCPATH}/ride/ride_data.c" "${OPENRCT2_SRCPATH}/ride/track_data.c" "${OPENRCT2_SRCPATH}/ride/track_data_old.c" "${OPENRCT2_SRCPATH}/ride/track_paint.c" "${OPENRCT2_SRCPATH}/rct2/addresses.c" "${OPENRCT2_SRCPATH}/diagnostic.c" "${OPENRCT2_SRCPATH}/rct2/hook.c" "${OPENRCT2_SRCPATH}/paint/map_element/map_element.c" "${OPENRCT2_SRCPATH}/paint/paint_helpers.c")
file(GLOB_RECURSE ORCT2_TESTPAINT_SOURCES "test/testpaint/*.c" "test/testpaint/*.cpp" "test/testpaint/*.h")
set(OPENRCT2_SRCPATH "src/openrct2")
file(GLOB_RECURSE ORCT2_RIDE_SOURCES "${OPENRCT2_SRCPATH}/ride/*/*.c")
file(GLOB_RECURSE ORCT2_RIDE_DEP_SOURCES "${OPENRCT2_SRCPATH}/ride/ride_data.c" "${OPENRCT2_SRCPATH}/ride/track_data.c" "${OPENRCT2_SRCPATH}/ride/track_data_old.c" "${OPENRCT2_SRCPATH}/ride/track_paint.c" "${OPENRCT2_SRCPATH}/rct2/addresses.c" "${OPENRCT2_SRCPATH}/diagnostic.c" "${OPENRCT2_SRCPATH}/rct2/hook.c" "${OPENRCT2_SRCPATH}/paint/map_element/map_element.c" "${OPENRCT2_SRCPATH}/paint/paint_helpers.c")
file(GLOB_RECURSE ORCT2_TESTPAINT_SOURCES "test/testpaint/*.c" "test/testpaint/*.cpp" "test/testpaint/*.h")
add_executable(testpaint EXCLUDE_FROM_ALL ${ORCT2_RIDE_SOURCES} ${ORCT2_RIDE_DEP_SOURCES} ${ORCT2_TESTPAINT_SOURCES} ${RCT2_SECTIONS})
target_include_directories(testpaint PRIVATE "src/")
set_target_properties(testpaint PROPERTIES COMPILE_FLAGS "-DNO_VEHICLES -D__TESTPAINT__ -Wno-unused")
add_dependencies(testpaint segfiles)
add_executable(testpaint EXCLUDE_FROM_ALL ${ORCT2_RIDE_SOURCES} ${ORCT2_RIDE_DEP_SOURCES} ${ORCT2_TESTPAINT_SOURCES} ${RCT2_SECTIONS})
target_include_directories(testpaint PRIVATE "src/")
set_target_properties(testpaint PROPERTIES COMPILE_FLAGS "-DNO_VEHICLES -D__TESTPAINT__ -Wno-unused")
add_dependencies(testpaint segfiles)
endif ()
set(CPACK_PACKAGE_VERSION_MAJOR 0)

View File

@ -14,7 +14,7 @@ environment:
OPENRCT2_ORG_TOKEN:
secure: leQX3xCQpmBLGuMqrxjFlzexDt96ypNRMM5TTRVHbGE8PwVg9crgeykLc2BIZU6HDHveJCHqh2cGMdHtHYJYcw==
BUILD_SERVER: AppVeyor
PATH: $(PATH);C:\Program Files (x86)\Windows Kits\10\bin\x86
PATH: $(PATH);C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
install:
- ps: >-
.\scripts\ps\appveyor_install.ps1

View File

@ -152,6 +152,8 @@ Section "!OpenRCT2" Section1
; Copy executable
File /oname=${OPENRCT2_EXE} ${BINARY_DIR}\${OPENRCT2_EXE}
File /oname=openrct2.com ${BINARY_DIR}\openrct2.com
File /oname=openrct2.dll ${BINARY_DIR}\openrct2.dll
; Create the Registry Entries
WriteRegStr HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenRCT2" "Comments" "Visit ${APPURLLINK}"
@ -218,6 +220,8 @@ Section "Uninstall"
Delete "$INSTDIR\readme.txt"
Delete "$INSTDIR\contributors.md"
Delete "$INSTDIR\${OPENRCT2_EXE}"
Delete "$INSTDIR\openrct2.com"
Delete "$INSTDIR\openrct2.dll"
Delete "$INSTDIR\INSTALL.LOG"
; Data files

View File

@ -40,6 +40,8 @@
<NsisScript>$(DistDir)windows\install.nsi</NsisScript>
<OutputExe>$(TargetDir)openrct2.exe</OutputExe>
<OutputCom>$(TargetDir)openrct2.com</OutputCom>
<OutputDll>$(TargetDir)openrct2.dll</OutputDll>
<g2Output>$(TargetDir)data\g2.dat</g2Output>
<SignCertificate Condition="'$(SignCertificate)'==''">$(DistDir)windows\code-sign-key-openrct2.org.pfx</SignCertificate>
@ -75,15 +77,22 @@
<ItemGroup>
<g2Inputs Include="$(RootDir)resources\g2\*" />
<SignItems Include="$(OutputExe)" />
<SignItems Include="$(OutputDll)" />
<SignItems Include="$(OutputCom)" />
</ItemGroup>
<ItemGroup Label="Symbol Items">
<SymbolItems Include="$(OutputExe)" />
<SymbolItems Include="$([System.IO.Path]::ChangeExtension($(OutputExe), '.pdb'))" />
<SymbolItems Include="$(OutputCom)" />
<SymbolItems Include="$(OutputDll)" />
<SymbolItems Include="$(TargetDir)openrct2-dll.pdb" />
<SymbolItems Include="$(TargetDir)openrct2-win.pdb" />
</ItemGroup>
<ItemGroup Label="Publish Items">
<PublishItems Include="$(OutputExe)" />
<PublishItems Include="$(OutputCom)" />
<PublishItems Include="$(OutputDll)" />
<PublishItems Include="$(TargetDir)data" />
<PublishItems Include="$(DistDir)changelog.txt" />
<PublishItems Include="$(DistDir)known_issues.txt" />
@ -137,6 +146,7 @@
</PropertyGroup>
<ItemGroup>
<CleanItems Condition="'$(Platform)'=='Win32'" Include="$(OutputExe)" />
<CleanItems Include="$(OutputCom)" />
<CleanItems Include="$(g2Output)" />
<CleanItems Include="$(ArtifactsDir)openrct2-installer-$(Configuration)-$(Platform)*.exe" />
<CleanItems Include="$(ArtifactsDir)openrct2-portable-$(Configuration)-$(Platform)*.zip" />
@ -179,17 +189,8 @@
<Message Text="SlnProperties: $(SlnProperties)" />
<MSBuild Projects="openrct2.sln" Targets="Rebuild" Properties="$(SlnProperties)" />
</Target>
<Target Name="BuildTests">
<PropertyGroup>
<Configuration Condition="'$(Configuration)'=='Debug'">DebugTests</Configuration>
<Configuration Condition="'$(Configuration)'=='Release'">ReleaseTests</Configuration>
<SlnProperties>$(SlnProperties);Configuration=$(Configuration)</SlnProperties>
</PropertyGroup>
<Message Text="SlnProperties: $(SlnProperties)" />
<MSBuild Projects="openrct2.sln" Targets="Build" Properties="$(SlnProperties)" />
</Target>
<Target Name="Test" DependsOnTargets="BuildTests">
<Target Name="Test" DependsOnTargets="Build">
<Exec Command="$(TargetDir)tests\tests.exe" />
</Target>
<Target Name="TestPaint" DependsOnTargets="Build" Condition="'$(Platform)'=='Win32'">
@ -204,6 +205,12 @@
StandardOutputImportance="low" />
</Target>
<!-- Target to create openrct2.exe (windows) and openrct2.com (console) -->
<Target Name="CreateGUI" DependsOnTargets="Build" AfterTargets="Build" Inputs="$(OutputExe)" Outputs="$(OutputCom)">
<Copy SourceFiles="$(OutputExe)" DestinationFiles="$(OutputCom)" />
<Exec Command="editbin /subsystem:windows $(OutputExe)" />
</Target>
<!-- Target to download the title sequences -->
<Target Name="DownloadTitleSequences" AfterTargets="Build">
<DownloadDependency Name="TitleSequences"

View File

@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openrct2", "src\openrct2\openrct2.vcxproj", "{D24D94F6-2A74-480C-B512-629C306CE92F}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libopenrct2", "src\openrct2\libopenrct2.vcxproj", "{D24D94F6-2A74-480C-B512-629C306CE92F}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "testpaint", "test\testpaint\testpaint.vcxproj", "{57E60BA1-FB76-4316-909E-C1449C142327}"
EndProject
@ -16,55 +16,62 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{2202A816-377
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{480B577D-4E4A-4757-9A42-28A9AD33E6B0}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openrct2-win", "src\openrct2-win\openrct2-win.vcxproj", "{7A9A57D5-7006-4208-A290-5491BA3C8808}"
ProjectSection(ProjectDependencies) = postProject
{7B8DB129-79EF-417E-B372-8A18E009D261} = {7B8DB129-79EF-417E-B372-8A18E009D261}
{D24D94F6-2A74-480C-B512-629C306CE92F} = {D24D94F6-2A74-480C-B512-629C306CE92F}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openrct2-dll", "src\openrct2-dll\openrct2-dll.vcxproj", "{7B8DB129-79EF-417E-B372-8A18E009D261}"
ProjectSection(ProjectDependencies) = postProject
{D24D94F6-2A74-480C-B512-629C306CE92F} = {D24D94F6-2A74-480C-B512-629C306CE92F}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
DebugTests|Win32 = DebugTests|Win32
DebugTests|x64 = DebugTests|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
ReleaseTests|Win32 = ReleaseTests|Win32
ReleaseTests|x64 = ReleaseTests|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D24D94F6-2A74-480C-B512-629C306CE92F}.Debug|Win32.ActiveCfg = Debug|Win32
{D24D94F6-2A74-480C-B512-629C306CE92F}.Debug|Win32.Build.0 = Debug|Win32
{D24D94F6-2A74-480C-B512-629C306CE92F}.Debug|x64.ActiveCfg = Debug|x64
{D24D94F6-2A74-480C-B512-629C306CE92F}.Debug|x64.Build.0 = Debug|x64
{D24D94F6-2A74-480C-B512-629C306CE92F}.DebugTests|Win32.ActiveCfg = DebugTests|Win32
{D24D94F6-2A74-480C-B512-629C306CE92F}.DebugTests|Win32.Build.0 = DebugTests|Win32
{D24D94F6-2A74-480C-B512-629C306CE92F}.DebugTests|x64.ActiveCfg = DebugTests|x64
{D24D94F6-2A74-480C-B512-629C306CE92F}.DebugTests|x64.Build.0 = DebugTests|x64
{D24D94F6-2A74-480C-B512-629C306CE92F}.Release|Win32.ActiveCfg = Release|Win32
{D24D94F6-2A74-480C-B512-629C306CE92F}.Release|Win32.Build.0 = Release|Win32
{D24D94F6-2A74-480C-B512-629C306CE92F}.Release|x64.ActiveCfg = Release|x64
{D24D94F6-2A74-480C-B512-629C306CE92F}.Release|x64.Build.0 = Release|x64
{D24D94F6-2A74-480C-B512-629C306CE92F}.ReleaseTests|Win32.ActiveCfg = ReleaseTests|Win32
{D24D94F6-2A74-480C-B512-629C306CE92F}.ReleaseTests|Win32.Build.0 = ReleaseTests|Win32
{D24D94F6-2A74-480C-B512-629C306CE92F}.ReleaseTests|x64.ActiveCfg = ReleaseTests|x64
{D24D94F6-2A74-480C-B512-629C306CE92F}.ReleaseTests|x64.Build.0 = ReleaseTests|x64
{57E60BA1-FB76-4316-909E-C1449C142327}.Debug|Win32.ActiveCfg = Debug|Win32
{57E60BA1-FB76-4316-909E-C1449C142327}.Debug|Win32.Build.0 = Debug|Win32
{57E60BA1-FB76-4316-909E-C1449C142327}.Debug|x64.ActiveCfg = Debug|Win32
{57E60BA1-FB76-4316-909E-C1449C142327}.DebugTests|Win32.ActiveCfg = Debug|Win32
{57E60BA1-FB76-4316-909E-C1449C142327}.DebugTests|x64.ActiveCfg = Debug|Win32
{57E60BA1-FB76-4316-909E-C1449C142327}.Release|Win32.ActiveCfg = Release|Win32
{57E60BA1-FB76-4316-909E-C1449C142327}.Release|x64.ActiveCfg = Release|Win32
{57E60BA1-FB76-4316-909E-C1449C142327}.ReleaseTests|Win32.ActiveCfg = Release|Win32
{57E60BA1-FB76-4316-909E-C1449C142327}.ReleaseTests|x64.ActiveCfg = Release|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|Win32.ActiveCfg = DebugTests|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|x64.ActiveCfg = DebugTests|x64
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.DebugTests|Win32.ActiveCfg = DebugTests|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.DebugTests|Win32.Build.0 = DebugTests|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.DebugTests|x64.ActiveCfg = DebugTests|x64
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.DebugTests|x64.Build.0 = DebugTests|x64
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|Win32.ActiveCfg = ReleaseTests|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|x64.ActiveCfg = ReleaseTests|x64
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.ReleaseTests|Win32.ActiveCfg = ReleaseTests|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.ReleaseTests|Win32.Build.0 = ReleaseTests|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.ReleaseTests|x64.ActiveCfg = ReleaseTests|x64
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.ReleaseTests|x64.Build.0 = ReleaseTests|x64
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|Win32.ActiveCfg = Debug|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|Win32.Build.0 = Debug|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|x64.ActiveCfg = Debug|x64
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Debug|x64.Build.0 = Debug|x64
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|Win32.ActiveCfg = Release|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|Win32.Build.0 = Release|Win32
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|x64.ActiveCfg = Release|x64
{62B020FA-E4FB-4C6E-B32A-DC999470F155}.Release|x64.Build.0 = Release|x64
{7A9A57D5-7006-4208-A290-5491BA3C8808}.Debug|Win32.ActiveCfg = Debug|Win32
{7A9A57D5-7006-4208-A290-5491BA3C8808}.Debug|Win32.Build.0 = Debug|Win32
{7A9A57D5-7006-4208-A290-5491BA3C8808}.Debug|x64.ActiveCfg = Debug|x64
{7A9A57D5-7006-4208-A290-5491BA3C8808}.Debug|x64.Build.0 = Debug|x64
{7A9A57D5-7006-4208-A290-5491BA3C8808}.Release|Win32.ActiveCfg = Release|Win32
{7A9A57D5-7006-4208-A290-5491BA3C8808}.Release|Win32.Build.0 = Release|Win32
{7A9A57D5-7006-4208-A290-5491BA3C8808}.Release|x64.ActiveCfg = Release|x64
{7A9A57D5-7006-4208-A290-5491BA3C8808}.Release|x64.Build.0 = Release|x64
{7B8DB129-79EF-417E-B372-8A18E009D261}.Debug|Win32.ActiveCfg = Debug|Win32
{7B8DB129-79EF-417E-B372-8A18E009D261}.Debug|Win32.Build.0 = Debug|Win32
{7B8DB129-79EF-417E-B372-8A18E009D261}.Debug|x64.ActiveCfg = Debug|x64
{7B8DB129-79EF-417E-B372-8A18E009D261}.Debug|x64.Build.0 = Debug|x64
{7B8DB129-79EF-417E-B372-8A18E009D261}.Release|Win32.ActiveCfg = Release|Win32
{7B8DB129-79EF-417E-B372-8A18E009D261}.Release|Win32.Build.0 = Release|Win32
{7B8DB129-79EF-417E-B372-8A18E009D261}.Release|x64.ActiveCfg = Release|x64
{7B8DB129-79EF-417E-B372-8A18E009D261}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -73,5 +80,7 @@ Global
{D24D94F6-2A74-480C-B512-629C306CE92F} = {2202A816-377D-4FA0-A7AF-7D4105F8A4FB}
{57E60BA1-FB76-4316-909E-C1449C142327} = {480B577D-4E4A-4757-9A42-28A9AD33E6B0}
{62B020FA-E4FB-4C6E-B32A-DC999470F155} = {480B577D-4E4A-4757-9A42-28A9AD33E6B0}
{7A9A57D5-7006-4208-A290-5491BA3C8808} = {2202A816-377D-4FA0-A7AF-7D4105F8A4FB}
{7B8DB129-79EF-417E-B372-8A18E009D261} = {2202A816-377D-4FA0-A7AF-7D4105F8A4FB}
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,80 @@
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#define WIN32_LEAN_AND_MEAN
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <shellapi.h>
#include <openrct2/OpenRCT2.h>
#define DLLEXPORT extern "C" __declspec(dllexport)
static char * * GetCommandLineArgs(int argc, wchar_t * * argvW);
static void FreeCommandLineArgs(int argc, char * * argv);
static char * ConvertUTF16toUTF8(const wchar_t * src);
DLLEXPORT int LaunchOpenRCT2(int argc, wchar_t * * argvW)
{
char * * argv = GetCommandLineArgs(argc, argvW);
if (argv == nullptr)
{
puts("Unable to fetch command line arguments.");
return -1;
}
int exitCode = RunOpenRCT2(argc, argv);
FreeCommandLineArgs(argc, argv);
return exitCode;
}
static char * * GetCommandLineArgs(int argc, wchar_t * * argvW)
{
// Allocate UTF-8 strings
char * * argv = (char * *)malloc(argc * sizeof(char *));
if (argv == nullptr)
{
return false;
}
// Convert to UTF-8
for (int i = 0; i < argc; i++)
{
argv[i] = ConvertUTF16toUTF8(argvW[i]);
}
return argv;
}
static void FreeCommandLineArgs(int argc, char * * argv)
{
// Free argv
for (int i = 0; i < argc; i++)
{
free(argv[i]);
}
free(argv);
}
static char * ConvertUTF16toUTF8(const wchar_t * src)
{
int srcLen = lstrlenW(src);
int sizeReq = WideCharToMultiByte(CP_UTF8, 0, src, srcLen, nullptr, 0, nullptr, nullptr);
char * result = (char *)calloc(1, sizeReq + 1);
WideCharToMultiByte(CP_UTF8, 0, src, srcLen, result, sizeReq, nullptr, nullptr);
return result;
}

View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="'$(SolutionDir)'==''">..\..\</SolutionDir>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7B8DB129-79EF-417E-B372-8A18E009D261}</ProjectGuid>
<RootNamespace>openrct2-dll</RootNamespace>
<ProjectName>openrct2-dll</ProjectName>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="..\..\openrct2.common.props" />
<PropertyGroup>
<TargetName>openrct2</TargetName>
<LibraryPath>$(SolutionDir)bin;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions Condition="'$(Configuration)'=='DebugTests' OR '$(Configuration)'=='ReleaseTests'">__NOENTRYPOINT__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<AdditionalOptions>$(OPENRCT2_CL_ADDITIONALOPTIONS) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>libopenrct2.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ProgramDatabaseFile>$(OutDir)openrct2-dll.pdb</ProgramDatabaseFile>
</Link>
<Lib>
<TargetMachine Condition="'$(Platform)'=='Win32'">MachineX86</TargetMachine>
<TargetMachine Condition="'$(Platform)'=='x64'">MachineX64</TargetMachine>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="..\..\resources\OpenRCT2.rc" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="openrct2-dll.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -0,0 +1,33 @@
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers
/*****************************************************************************
* OpenRCT2, an open source clone of Roller Coaster Tycoon 2.
*
* OpenRCT2 is the work of many authors, a full list can be found in contributors.md
* For more information, visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* A full copy of the GNU General Public License can be found in licence.txt
*****************************************************************************/
#pragma endregion
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
// Enable visual styles
#pragma comment(linker, "\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
#define DLLIMPORT extern "C"
DLLIMPORT int LaunchOpenRCT2(int argc, wchar_t * * argv);
/**
* Windows entry point to OpenRCT2 with a console window using a traditional C main function.
*/
int wmain(int argc, wchar_t * * argvW, wchar_t * envp)
{
return LaunchOpenRCT2(argc, argvW);
}

View File

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SolutionDir Condition="'$(SolutionDir)'==''">..\..\</SolutionDir>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{7A9A57D5-7006-4208-A290-5491BA3C8808}</ProjectGuid>
<RootNamespace>openrct2-win</RootNamespace>
<ProjectName>openrct2-win</ProjectName>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
</PropertyGroup>
<Import Project="..\..\openrct2.common.props" />
<PropertyGroup>
<TargetName>openrct2</TargetName>
<LibraryPath>$(SolutionDir)bin;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions Condition="'$(Configuration)'=='DebugTests' OR '$(Configuration)'=='ReleaseTests'">__NOENTRYPOINT__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<AdditionalOptions>$(OPENRCT2_CL_ADDITIONALOPTIONS) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<AdditionalDependencies>openrct2.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ProgramDatabaseFile>$(OutDir)openrct2-win.pdb</ProgramDatabaseFile>
<SubSystem>Console</SubSystem>
</Link>
<Lib>
<TargetMachine Condition="'$(Platform)'=='Win32'">MachineX86</TargetMachine>
<TargetMachine Condition="'$(Platform)'=='x64'">MachineX64</TargetMachine>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ResourceCompile Include="..\..\resources\OpenRCT2.rc" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="openrct2-win.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@ -87,6 +87,10 @@ extern "C"
int cmdline_run(const char * * argv, int argc);
#ifdef __WINDOWS__
int RunOpenRCT2(int argc, char * * argv);
#endif
#ifdef __cplusplus
}
#endif

View File

@ -39,10 +39,6 @@ extern "C"
#define IMPLIES_SILENT_BREAKPAD
#endif // USE_BREAKPAD
#if defined(__WINDOWS__) && !defined(DEBUG)
#define __PROVIDE_CONSOLE__ 1
#endif // defined(__WINDOWS__) && !defined(DEBUG)
#ifndef DISABLE_NETWORK
int gNetworkStart = NETWORK_MODE_NONE;
char gNetworkStartHost[128];
@ -51,10 +47,6 @@ int gNetworkStartPort = NETWORK_DEFAULT_PORT;
static uint32 _port = 0;
#endif
#ifdef __PROVIDE_CONSOLE__
static bool _provideConsole;
#endif
static bool _help = false;
static bool _version = false;
static bool _noInstall = false;
@ -77,9 +69,6 @@ static const CommandLineOptionDefinition StandardOptions[]
{ CMDLINE_TYPE_SWITCH, &_about, NAC, "about", "show information about " OPENRCT2_NAME },
{ CMDLINE_TYPE_SWITCH, &_verbose, NAC, "verbose", "log verbose messages" },
{ CMDLINE_TYPE_SWITCH, &_headless, NAC, "headless", "run " OPENRCT2_NAME " headless" IMPLIES_SILENT_BREAKPAD },
#ifdef __PROVIDE_CONSOLE__
{ CMDLINE_TYPE_SWITCH, &_provideConsole, NAC, "console", "creates a new or attaches to an existing console window for standard output" },
#endif
#ifndef DISABLE_NETWORK
{ CMDLINE_TYPE_INTEGER, &_port, NAC, "port", "port to use for hosting or joining a server" },
#endif
@ -166,13 +155,6 @@ exitcode_t CommandLine::HandleCommandDefault()
{
exitcode_t result = EXITCODE_CONTINUE;
#ifdef __PROVIDE_CONSOLE__
if (_provideConsole)
{
platform_windows_open_console();
}
#endif
if (_about)
{
PrintAbout();

View File

@ -12,14 +12,6 @@
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugTests|Win32">
<Configuration>DebugTests</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugTests|x64">
<Configuration>DebugTests</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
@ -28,35 +20,23 @@
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseTests|Win32">
<Configuration>ReleaseTests</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseTests|x64">
<Configuration>ReleaseTests</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{D24D94F6-2A74-480C-B512-629C306CE92F}</ProjectGuid>
<RootNamespace>openrct2</RootNamespace>
<ProjectName>openrct2</ProjectName>
<RootNamespace>openrct2-lib</RootNamespace>
<ProjectName>libopenrct2</ProjectName>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<!-- Debug|Win32 is reserved for RCT2 interop builds, this means it has to be a DLL -->
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ConfigurationType>DynamicLibrary</ConfigurationType>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)'=='DebugTests' OR '$(Configuration)'=='ReleaseTests'">
<ConfigurationType>StaticLibrary</ConfigurationType>
</PropertyGroup>
<Import Project="..\..\openrct2.common.props" />
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions Condition="'$(Breakpad)'=='true'">USE_BREAKPAD;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)'=='DebugTests' OR '$(Configuration)'=='ReleaseTests'">__NOENTRYPOINT__;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
@ -64,10 +44,6 @@
<ObjectFileName>$(IntDir)\%(RelativeDir)</ObjectFileName>
<AdditionalOptions>$(OPENRCT2_CL_ADDITIONALOPTIONS) %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem Condition="'$(Configuration)'!='Release'">Console</SubSystem>
<SubSystem Condition="'$(Configuration)'=='Release'">Windows</SubSystem>
</Link>
<Lib>
<TargetMachine Condition="'$(Platform)'=='Win32'">MachineX86</TargetMachine>
<TargetMachine Condition="'$(Platform)'=='x64'">MachineX64</TargetMachine>

View File

@ -183,63 +183,69 @@ void research_finish_item(sint32 entryIndex)
int base_ride_type = (entryIndex >> 8) & 0xFF;
int rideEntryIndex = entryIndex & 0xFF;
rct_ride_entry *rideEntry = get_ride_entry(rideEntryIndex);
ride_type_set_invented(base_ride_type);
gResearchedTrackTypesA[base_ride_type] = (RideTypePossibleTrackConfigurations[base_ride_type] ) & 0xFFFFFFFFULL;
gResearchedTrackTypesB[base_ride_type] = (RideTypePossibleTrackConfigurations[base_ride_type] >> 32ULL) & 0xFFFFFFFFULL;
if (rideEntry != NULL && rideEntry != (rct_ride_entry *)-1)
{
ride_type_set_invented(base_ride_type);
gResearchedTrackTypesA[base_ride_type] = (RideTypePossibleTrackConfigurations[base_ride_type]) & 0xFFFFFFFFULL;
gResearchedTrackTypesB[base_ride_type] = (RideTypePossibleTrackConfigurations[base_ride_type] >> 32ULL) & 0xFFFFFFFFULL;
if (RideData4[base_ride_type].flags & RIDE_TYPE_FLAG4_3) {
int ebx = RideData4[base_ride_type].alternate_type;
gResearchedTrackTypesA[ebx] = (RideTypePossibleTrackConfigurations[ebx] ) & 0xFFFFFFFFULL;
gResearchedTrackTypesB[ebx] = (RideTypePossibleTrackConfigurations[ebx] >> 32ULL) & 0xFFFFFFFFULL;
}
if (RideData4[base_ride_type].flags & RIDE_TYPE_FLAG4_3) {
int ebx = RideData4[base_ride_type].alternate_type;
gResearchedTrackTypesA[ebx] = (RideTypePossibleTrackConfigurations[ebx]) & 0xFFFFFFFFULL;
gResearchedTrackTypesB[ebx] = (RideTypePossibleTrackConfigurations[ebx] >> 32ULL) & 0xFFFFFFFFULL;
}
ride_entry_set_invented(rideEntryIndex);
ride_entry_set_invented(rideEntryIndex);
if (!(rideEntry->flags & RIDE_ENTRY_FLAG_SEPARATE_RIDE)) {
for (int i = 0; i < 128; i++) {
rct_ride_entry *rideEntry2 = get_ride_entry(i);
if (rideEntry2 == (rct_ride_entry*)-1)
continue;
if ((rideEntry2->flags & RIDE_ENTRY_FLAG_SEPARATE_RIDE))
continue;
if (!(rideEntry->flags & RIDE_ENTRY_FLAG_SEPARATE_RIDE)) {
for (int i = 0; i < 128; i++) {
rct_ride_entry *rideEntry2 = get_ride_entry(i);
if (rideEntry2 == (rct_ride_entry*)-1)
continue;
if ((rideEntry2->flags & RIDE_ENTRY_FLAG_SEPARATE_RIDE))
continue;
if (rideEntry2->ride_type[0] == base_ride_type ||
rideEntry2->ride_type[1] == base_ride_type ||
rideEntry2->ride_type[2] == base_ride_type
) {
ride_entry_set_invented(i);
if (rideEntry2->ride_type[0] == base_ride_type ||
rideEntry2->ride_type[1] == base_ride_type ||
rideEntry2->ride_type[2] == base_ride_type
) {
ride_entry_set_invented(i);
}
}
}
}
set_format_arg(0, rct_string_id, ((rideEntry->flags & RIDE_ENTRY_FLAG_SEPARATE_RIDE_NAME)) ?
rideEntry->name : RideNaming[base_ride_type].name);
set_format_arg(0, rct_string_id, ((rideEntry->flags & RIDE_ENTRY_FLAG_SEPARATE_RIDE_NAME)) ?
rideEntry->name : RideNaming[base_ride_type].name);
if (!gSilentResearch) {
if (gConfigNotifications.ride_researched) {
news_item_add_to_queue(NEWS_ITEM_RESEARCH, STR_NEWS_ITEM_RESEARCH_NEW_RIDE_AVAILABLE, entryIndex);
if (!gSilentResearch) {
if (gConfigNotifications.ride_researched) {
news_item_add_to_queue(NEWS_ITEM_RESEARCH, STR_NEWS_ITEM_RESEARCH_NEW_RIDE_AVAILABLE, entryIndex);
}
}
}
research_invalidate_related_windows();
research_invalidate_related_windows();
}
} else {
// Scenery
rct_scenery_set_entry *scenerySetEntry = get_scenery_group_entry(entryIndex & 0xFFFF);
for (int i = 0; i < scenerySetEntry->entry_count; i++) {
int subSceneryEntryIndex = scenerySetEntry->scenery_entries[i];
gResearchedSceneryItems[subSceneryEntryIndex >> 5] |= 1UL << (subSceneryEntryIndex & 0x1F);
}
set_format_arg(0, rct_string_id, scenerySetEntry->name);
if (!gSilentResearch) {
if (gConfigNotifications.ride_researched) {
news_item_add_to_queue(NEWS_ITEM_RESEARCH, STR_NEWS_ITEM_RESEARCH_NEW_SCENERY_SET_AVAILABLE, entryIndex);
if (scenerySetEntry != NULL && scenerySetEntry != (rct_scenery_set_entry *)-1)
{
for (int i = 0; i < scenerySetEntry->entry_count; i++) {
int subSceneryEntryIndex = scenerySetEntry->scenery_entries[i];
gResearchedSceneryItems[subSceneryEntryIndex >> 5] |= 1UL << (subSceneryEntryIndex & 0x1F);
}
}
research_invalidate_related_windows();
init_scenery();
set_format_arg(0, rct_string_id, scenerySetEntry->name);
if (!gSilentResearch) {
if (gConfigNotifications.ride_researched) {
news_item_add_to_queue(NEWS_ITEM_RESEARCH, STR_NEWS_ITEM_RESEARCH_NEW_SCENERY_SET_AVAILABLE, entryIndex);
}
}
research_invalidate_related_windows();
init_scenery();
}
}
}

View File

@ -220,8 +220,6 @@ void core_init();
#include <windows.h>
#undef GetMessage
void platform_windows_open_console();
void platform_windows_close_console();
int windows_get_registry_install_info(rct2_install_info *installInfo, char *source, char *font, uint8 charset);
HWND windows_get_window_handle();
void platform_setup_file_associations();

View File

@ -643,10 +643,6 @@ void platform_free()
platform_close_window();
SDL_Quit();
#ifdef __WINDOWS__
platform_windows_close_console();
#endif
}
void platform_start_text_input(utf8* buffer, int max_length)

View File

@ -47,7 +47,6 @@
static utf8 _userDataDirectoryPath[MAX_PATH] = { 0 };
static utf8 _openrctDataDirectoryPath[MAX_PATH] = { 0 };
static bool _consoleIsAttached = false;
utf8 **windows_get_command_line_args(int *outNumArgs);
@ -55,38 +54,10 @@ utf8 **windows_get_command_line_args(int *outNumArgs);
static HMODULE _dllModule = NULL;
#if defined(NO_RCT2) && !defined(__NOENTRYPOINT__)
/**
* Windows entry point to OpenRCT2 without a console window.
*/
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
_dllModule = hInstance;
core_init();
int argc;
char ** argv = (char**)windows_get_command_line_args(&argc);
int runGame = cmdline_run((const char **)argv, argc);
// Free argv
for (int i = 0; i < argc; i++) {
free(argv[i]);
}
free(argv);
if (runGame == 1) {
openrct2_launch();
}
return gExitCode;
}
/**
* Windows entry point to OpenRCT2 with a console window using a traditional C main function.
*/
int main(int argc, char *argv[])
int RunOpenRCT2(int argc, char * * argv)
{
HINSTANCE hInstance = GetModuleHandle(NULL);
_dllModule = hInstance;
@ -101,6 +72,17 @@ int main(int argc, char *argv[])
return gExitCode;
}
#ifdef NO_RCT2
#ifdef __MINGW32__
int main(int argc, char **argv)
{
return RunOpenRCT2(argc, argv);
}
#endif
#else
/* DllMain is already defined in one of static libraries we implicitly depend
@ -153,28 +135,6 @@ __declspec(dllexport) int StartOpenRCT(HINSTANCE hInstance, HINSTANCE hPrevInsta
#endif // NO_RCT2
void platform_windows_open_console()
{
if (!AttachConsole(ATTACH_PARENT_PROCESS)) {
if (!AllocConsole()) {
return;
}
}
freopen("CONIN$", "r", stdin);
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
_consoleIsAttached = true;
}
void platform_windows_close_console()
{
if (_consoleIsAttached) {
_consoleIsAttached = false;
FreeConsole();
}
}
utf8 **windows_get_command_line_args(int *outNumArgs)
{
int argc;

View File

@ -5,20 +5,20 @@
<GtestDir Condition="'$(GtestDir)'==''">$(SolutionDir)lib\googletest\googletest</GtestDir>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugTests|Win32">
<Configuration>DebugTests</Configuration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseTests|Win32">
<Configuration>ReleaseTests</Configuration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="DebugTests|x64">
<Configuration>DebugTests</Configuration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseTests|x64">
<Configuration>ReleaseTests</Configuration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
@ -33,7 +33,7 @@
<Import Project="..\..\openrct2.common.props" />
<PropertyGroup>
<OutDir>$(SolutionDir)bin\tests\</OutDir>
<IncludePath>$(GtestDir);$(GtestDir)\include;$(SolutionDir)src\openrct2;$(IncludePath)</IncludePath>
<IncludePath>$(GtestDir);$(GtestDir)\include;$(IncludePath)</IncludePath>
<LibraryPath>$(SolutionDir)bin;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup>
@ -41,7 +41,7 @@
<PreprocessorDefinitions>GTEST_LANG_CXX11;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<AdditionalDependencies>openrct2.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>libopenrct2.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>