bugfix: some examples didn't compile with -DWITHOUT_EASY

このコミットが含まれているのは:
tastytea 2018-07-19 11:06:16 +02:00
コミット 63fd9f581c
署名者: tastytea
GPGキーID: CFC39497F1B26E07
6個のファイルの変更32行の追加2行の削除

ファイルの表示

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.7)
project (mastodon-cpp
VERSION 0.18.2
VERSION 0.18.3
LANGUAGES CXX
)
@ -8,7 +8,9 @@ include(GNUInstallDirs)
find_package(PkgConfig REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(CURLPP REQUIRED curlpp)
pkg_check_modules(JSONCPP REQUIRED jsoncpp)
if(NOT WITHOUT_EASY)
pkg_check_modules(JSONCPP REQUIRED jsoncpp)
endif()
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@ -62,6 +64,7 @@ set_target_properties(mastodon-cpp PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${mastodon-cpp_VERSION_MAJOR}
)
if(WITHOUT_EASY)
target_link_libraries(mastodon-cpp ${CURLPP_LIBRARIES})
else()

ファイルの表示

@ -120,6 +120,7 @@ int main(int argc, char *argv[])
}
#else
#include <cstdio>
int main()
{
printf("mastodon-cpp was compiled without Easy support.\n");

ファイルの表示

@ -102,6 +102,7 @@ int main(int argc, char *argv[])
}
#else
#include <cstdio>
int main()
{
printf("mastodon-cpp was compiled without Easy support.\n");

ファイルの表示

@ -121,6 +121,7 @@ int main(int argc, char *argv[])
}
#else
#include <cstdio>
int main()
{
printf("mastodon-cpp was compiled without Easy support.\n");

ファイルの表示

@ -2,6 +2,9 @@
* Get fields from own account.
*/
// Don't compile this if the Easy-interface is turned off
#ifndef WITHOUT_EASY
#include <iostream>
#include <vector>
#include <string>
@ -43,3 +46,12 @@ int main(int argc, char *argv[])
return 0;
}
#else
#include <cstdio>
int main()
{
printf("mastodon-cpp was compiled without Easy support.\n");
return 255;
}
#endif // WITHOUT_EASY

ファイルの表示

@ -1,6 +1,9 @@
/* This file is part of mastodon-cpp.
*/
// Don't compile this if the Easy-interface is turned off
#ifndef WITHOUT_EASY
#include <iostream>
#include <cstdint>
#include "mastodon-cpp.hpp"
@ -25,3 +28,12 @@ int main(int argc, char *argv[])
std::cout << ret << ": " << answer << '\n';
return 1;
}
#else
#include <cstdio>
int main()
{
printf("mastodon-cpp was compiled without Easy support.\n");
return 0;
}
#endif // WITHOUT_EASY