-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/removing ext submodules #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| [submodule "external/rapidjson"] | ||
| path = external/rapidjson | ||
| url = https://github.com/Wire-Network/rapidjson.git | ||
| ; [submodule "external/rapidjson"] | ||
| ; path = external/rapidjson | ||
| ; url = https://github.com/Wire-Network/rapidjson.git | ||
| [submodule "external/wirejs-native"] | ||
| path = external/wirejs-native | ||
| url = https://github.com/Wire-Network/wirejs-native |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,13 @@ | |
| cmake_minimum_required (VERSION 3.8) | ||
| project(abieos VERSION 0.1 LANGUAGES CXX C) | ||
|
|
||
| if (NOT TARGET rapidjson) | ||
| find_package(RapidJSON REQUIRED) | ||
| if(NOT TARGET rapidjson) | ||
| message(FATAL_ERROR "RapidJSON not found!") | ||
| endif() | ||
| endif() | ||
|
|
||
| set(default_build_type "Release") | ||
|
|
||
| if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | ||
|
|
@@ -38,20 +45,21 @@ include(GNUInstallDirs) | |
| add_library(abieos STATIC src/abi.cpp src/crypto.cpp include/sysio/fpconv.c) | ||
| target_include_directories(abieos PUBLIC | ||
| "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/include" | ||
| "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/external/rapidjson/include" | ||
| "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>") | ||
|
|
||
| target_link_libraries(abieos rapidjson) | ||
|
||
|
|
||
| if(ABIEOS_NO_INT128) | ||
| target_compile_definitions(abieos PUBLIC ABIEOS_NO_INT128) | ||
| endif() | ||
|
|
||
| add_library(abieos_module MODULE src/abieos.cpp src/abi.cpp src/crypto.cpp include/sysio/fpconv.c) | ||
| target_include_directories(abieos_module PUBLIC | ||
| "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/include;" | ||
| "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>/external/rapidjson/include" | ||
|
|
||
| "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>") | ||
|
|
||
| target_link_libraries(abieos_module ${CMAKE_THREAD_LIBS_INIT}) | ||
| target_link_libraries(abieos_module ${CMAKE_THREAD_LIBS_INIT} rapidjson) | ||
|
||
| set_target_properties(abieos_module PROPERTIES OUTPUT_NAME "abieos") | ||
|
|
||
| enable_testing() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic is inconsistent:
find_package(RapidJSON REQUIRED)should create a target, but the code checks forrapidjson(lowercase) while the package name isRapidJSON(camelcase). The target name created by find_package may be different. Consider usingRapidJSON::RapidJSONor check the actual target name created by the RapidJSON CMake package.