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

Commit

Permalink
CMAKE_POSITION_INDEPENDENT_CODE added to static build
Browse files Browse the repository at this point in the history
  • Loading branch information
Turupawn committed Oct 31, 2018
1 parent fd62fe5 commit 6cbc8ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
7 changes: 5 additions & 2 deletions test/test_modio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
Expand All @@ -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.