Skip to content
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

Replace readline library, Issue 673 #685

Merged
merged 11 commits into from
Mar 9, 2018
23 changes: 11 additions & 12 deletions programs/cli_wallet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,19 @@ if( GPERFTOOLS_FOUND )
list( APPEND PLATFORM_SPECIFIC_LIBS tcmalloc )
endif()

find_package( Editline )
if ( EDITLINE_FOUND )
message ( STATUS "Found Editline; compiling cli_wallet with Editline" )
list ( APPEND PLATFORM_SPECIFIC_LIBS editline )
add_library (editline STATIC IMPORTED )
set_target_properties ( editline PROPERTIES IMPORTED_LOCATION ${Editline_LIBRARY} )
endif()


target_link_libraries( cli_wallet
PRIVATE graphene_app graphene_net graphene_chain graphene_egenesis_brief graphene_utilities graphene_wallet fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} )

if(MSVC)
target_link_libraries( cli_wallet
PRIVATE graphene_app graphene_net graphene_chain graphene_egenesis_brief graphene_utilities graphene_wallet fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't duplicate this line, instead, should make use of PLATFORM_SPECIFIC_LIBS. E.G.

if ( not MSVC )
   list ( APPEND PLATFORM_SPECIFIC_LIBS editline )
   ...
endif ( not MSVC )

By the way, is it sure that editline doesn't work under Windows? If it would work, we don't need this check at all.

set_source_files_properties( main.cpp PROPERTIES COMPILE_FLAGS "/bigobj" )
else (MSVC)
add_library(editline STATIC IMPORTED)
set_target_properties(editline PROPERTIES
IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/libraries/fc/vendor/editline/src/project_editline-build/src/.libs/libeditline.a"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not correct. Lib file should be "BINARY_DIR" based. I think my patch mentioned in a previous comment in this PR would work better (it didn't handle MSVC though).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I misread your patch several comments above. It is better than what I've done. I'm stealing it.

INTERFACE_INCLUDE_DIRECTORIES "$(CMAKE_SOURCE_DIR}/libraries/fc/vendor/editline/include")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not hard code "fc/vendor/editline" here since the directory structure should be decided by fc. Actually we don't need to specify this parameter here, since cli_wallet doesn't directly include the header files. Again, my patch mentioned above works.


target_link_libraries( cli_wallet
PRIVATE graphene_app editline graphene_net graphene_chain graphene_egenesis_brief graphene_utilities graphene_wallet fc ${CMAKE_DL_LIBS} ${PLATFORM_SPECIFIC_LIBS} )

endif(MSVC)

install( TARGETS
Expand Down