Permalink
Browse files

CMAKE_POSITION_INDEPENDENT_CODE added to static build

  • Loading branch information...
Turupawn committed Oct 31, 2018
1 parent fd62fe5 commit 6cbc8ed0aee6a6f3b51e3324fe88ade044896c82
Showing with 7 additions and 4 deletions.
  1. +2 −2 CMakeLists.txt
  2. +5 −2 test/test_modio.cpp
View
@@ -12,6 +12,7 @@ file(GLOB_RECURSE SOURCES "src/*.cpp")
if( mode AND mode STREQUAL "static" )
message("Building mod.io SDK statically")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_definitions(-DMODIO_STATICLIB -DCURL_STATICLIB)
add_library(modio STATIC ${SOURCES})
else()
@@ -56,7 +57,6 @@ IF( test AND test STREQUAL "on" )
enable_testing()
include_directories(${gtest_SOURCE_DIR}/include ${gtest_SOURCE_DIR})
add_executable(runUnitTests ${TEST_SRC_FILES})
target_link_libraries(runUnitTests gtest gtest_main)
target_link_libraries(runUnitTests modio)
target_link_libraries(runUnitTests gtest gtest_main modio)
add_test(UnitTests runUnitTests)
ENDIF()
View
@@ -3,7 +3,7 @@
#include "modio.h"
#include "json_examples.h"
modio::Instance modio_instance(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b");
//modio::Instance modio_instance(MODIO_ENVIRONMENT_TEST, 7, "e91c01b8882f4affeddd56c96111977b");
TEST(IndependentMethod, TestModioGameInitialization)
{
@@ -22,14 +22,15 @@ TEST(IndependentMethod, TestModioGameInitialization)
EXPECT_EQ(game.revenue_options, 1500);
EXPECT_EQ(game.api_access_options, 3);
EXPECT_EQ(game.maturity_options, 0);
EXPECT_STREQ(game.ugc_name, "map");
EXPECT_STREQ(game.name, "Rogue Knight");
EXPECT_STREQ(game.name_id, "rogue-knight");
EXPECT_STREQ(game.summary, "Rogue Knight is a brand new 2D pixel platformer.");
EXPECT_STREQ(game.instructions, "Instructions on the process to upload mods.");
EXPECT_STREQ(game.instructions_url, "https://www.rogue-knight-game.com/modding/getting-started");
EXPECT_STREQ(game.profile_url, "https://rogue-knight.mod.io");
modioFreeGame(&game);
}
TEST(IndependentMethod, TestModioModInitialization)
@@ -53,4 +54,6 @@ TEST(IndependentMethod, TestModioModInitialization)
EXPECT_STREQ(mod.description_plaintext, "Rogue HD Pack does exactly what you thi...");
EXPECT_STREQ(mod.metadata_blob, "rogue,hd,high-res,4k,hd textures");
EXPECT_STREQ(mod.profile_url, "https://rogue-knight.mod.io/rogue-knight-hd-pack");
modioFreeMod(&mod);
}

0 comments on commit 6cbc8ed

Please sign in to comment.