Skip to content
Permalink
Browse files

Merge branch 'master' into devel

  • Loading branch information
Turupawn committed Oct 15, 2019
2 parents e2788db + caa0195 commit 542ac095fb484dccc5c8e2f3e24b05fd89fa18e2
@@ -15,8 +15,8 @@ script:
fi
- make -j2
- if [[ "$TRAVIS_TAG" ]]; then
cmake -D mode=static . ;
make -j2 ;
cmake -D BUILD_SHARED_LIBS=OFF . ;
make -j2 ;
fi
- if [ "$TRAVIS_TAG" ]; then
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
@@ -1,10 +1,14 @@
cmake_minimum_required(VERSION 3.5)
project(modio)
set(CMAKE_BUILD_TYPE Release)
set (CMAKE_CXX_STANDARD 11)

# set the mode flag as static to compile statically, for example:
# cmake -D mode=static .
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()

# set BUILD_SHARED_LIBs to OFF to compile statically, for example:
# cmake -D BUILD_SHARED_LIBS=OFF .
option(BUILD_SHARED_LIBS "Build Shared Libraries" ON)

# MSVC: set the crtmode flag to 'static' to include the Visual C++
# runtime statically. Requires libcurl to be built with /MT as well.
@@ -14,15 +18,14 @@ include_directories(include additional_dependencies include/dependencies/miniz)

file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.c")

if( mode AND mode STREQUAL "static" )
add_library(modio ${SOURCES})
if( BUILD_SHARED_LIBS )
message("Building mod.io SDK dynamically")
add_definitions(-DMODIO_DYNAMICLIB -DCURL_STATICLIB)
else()
message("Building mod.io SDK statically")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_definitions(-DMODIO_STATICLIB -DCURL_STATICLIB)
add_library(modio STATIC ${SOURCES})
else()
message("Building mod.io SDK dynamically")
add_definitions(-DMODIO_DYNAMICLIB -DCURL_STATICLIB)
add_library(modio SHARED ${SOURCES})
endif()

IF (APPLE)
@@ -1,6 +1,6 @@
mkdir test_build
cd test_build
cmake -D mode=static -D test=on -D gtest_force_shared_crt=on -G "Visual Studio 15" c:\projects\source
cmake -D BUILD_SHARED_LIBS=OFF -D test=on -D gtest_force_shared_crt=on -G "Visual Studio 15" c:\projects\source
cmake --build . --config "Debug"
cd ..

@@ -16,11 +16,11 @@ if %APPVEYOR_REPO_TAG% == true (
cmake --build . --config "Release"
mkdir ..\static_x86
cd ..\static_x86
cmake -D mode=static -G "Visual Studio 15" c:\projects\source
cmake -D BUILD_SHARED_LIBS=OFF -G "Visual Studio 15" c:\projects\source
cmake --build . --config "Release"
mkdir ..\static_x64
cd ..\static_x64
cmake -D mode=static -G "Visual Studio 15 Win64" c:\projects\source
cmake -D BUILD_SHARED_LIBS=OFF -G "Visual Studio 15 Win64" c:\projects\source
cmake --build . --config "Release"
cd ..
7z a Windows.zip dynamic_x86\Release\* dynamic_x64\Release\* static_x86\Release\* static_x64\Release\*
@@ -65,7 +65,7 @@ const std::vector<modio::InstalledMod> Instance::getAllInstalledMods()
modioGetAllInstalledMods(modio_installed_mods);

all_installed_mods.resize(installed_mods_size);
for (u32 i = 0; i < (u32)installed_mods_size; i++)
for (size_t i = 0; i < installed_mods_size; i++)
{
all_installed_mods[i].initialize(modio_installed_mods[i]);
modioFreeInstalledMod(&modio_installed_mods[i]);
@@ -4,7 +4,7 @@ extern "C"
{
void modioInitError(ModioError* error, nlohmann::json error_json)
{
error->code = -1;
error->code = 0;
if(modio::hasKey(error_json, "code"))
error->code = error_json["code"];

@@ -23,8 +23,8 @@ void shutdownCurl()
{
pauseModDownloads();

g_ongoing_call = -1;
g_call_count = -1;
g_ongoing_call = 0;
g_call_count = 0;

curl_multi_cleanup(g_curl_multi_handle);

0 comments on commit 542ac09

Please sign in to comment.
You can’t perform that action at this time.