1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

Merge pull request #312 from michael-loki/fix_log_tag

Fix log tag after cmake changes
This commit is contained in:
Jeff 2019-02-15 15:51:08 -05:00 committed by GitHub
commit d75e925bda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 8 deletions

View file

@ -300,16 +300,17 @@ if(NOT WIN32)
add_subdirectory(vendor)
endif(NOT WIN32)
function(add_log_tag target)
get_target_property(TARGET_SRCS ${target} SOURCES)
foreach(F ${TARGET_SRCS})
set_source_files_properties(${F} PROPERTIES COMPILE_FLAGS -DLOG_TAG=\\\"${F}\\\")
endforeach(F)
endfunction()
add_subdirectory(crypto)
add_subdirectory(libutp)
add_subdirectory(llarp)
set(ALL_SRC ${EXE_SRC} ${LIB_PLATFORM_SRC} ${LIB_SRC})
foreach(F ${ALL_SRC})
set_source_files_properties(${F} PROPERTIES COMPILE_FLAGS -DLOG_TAG=\\\"${F}\\\")
endforeach(F)
if(SHADOW)
add_shadow_plugin(shadow-plugin-${SHARED_LIB} ${EXE_SRC} ${LIB_SRC} ${UTP_SRC} ${LIB_PLATFORM_SRC} ${CPP_BACKPORT_SRC} ${ABYSS_SRC} ${CRYPTOGRAPHY_SRC})
target_link_libraries(shadow-plugin-${SHARED_LIB} ${LIBS})
@ -321,6 +322,8 @@ else()
add_executable(${EXE} ${EXE_SRC} llarp/win32/version.rc)
endif(NOT WIN32)
add_log_tag(${EXE})
install(TARGETS ${EXE} RUNTIME DESTINATION bin)
if(WIN32)
install(PROGRAMS ${CMAKE_SOURCE_DIR}/lokinet-bootstrap.exe DESTINATION bin)
@ -341,6 +344,7 @@ else()
if(ANDROID)
add_library(${ANDROID_LIB} SHARED jni/lokinet_android.cpp)
add_log_tag(${ANDROID_LIB})
target_link_libraries(${ANDROID_LIB} ${STATIC_LIB} ${LIBS})
endif(ANDROID)
endif(SHADOW)
@ -357,7 +361,6 @@ if(USE_LIBABYSS)
${ABYSS}/src/json.cpp)
add_library(${ABYSS_LIB} STATIC ${ABYSS_SRC})
target_link_libraries(${ABYSS_LIB} PUBLIC ${PLATFORM_LIB})
list(APPEND ALL_SRC ${ABYSS_SRC} ${ABYSS}/main.cpp)
if (NOT WIN32)
add_executable(${ABYSS_EXE} ${ABYSS}/main.cpp)
@ -367,6 +370,9 @@ if(USE_LIBABYSS)
target_link_libraries(${ABYSS_EXE} PUBLIC ${ABYSS_LIB} ${STATIC_LIB} ws2_32)
endif(NOT WIN32)
add_log_tag(${ABYSS_EXE})
add_log_tag(${ABYSS_LIB})
target_include_directories(${UTIL_LIB} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/${ABYSS}/include")
target_include_directories(${ABYSS_LIB} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/${ABYSS}/include")
target_include_directories(${ABYSS_EXE} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/${ABYSS}/include")

View file

@ -112,4 +112,5 @@ set(CRYPTOGRAPHY_SRC
${NTRU_SRC})
add_library(${CRYPTOGRAPHY_LIB} STATIC ${CRYPTOGRAPHY_SRC})
add_log_tag(${CRYPTOGRAPHY_LIB})
target_include_directories (${CRYPTOGRAPHY_LIB} PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")

View file

@ -15,4 +15,5 @@ add_library(libutp STATIC ${UTP_SRC})
if(WIN32)
target_link_libraries(libutp ws2_32)
endif(WIN32)
target_include_directories(libutp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CORE_INCLUDE})
target_include_directories(libutp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CORE_INCLUDE})
add_log_tag(libutp)

View file

@ -220,4 +220,9 @@ if(WITH_SHARED)
target_link_libraries(${SHARED_LIB} ${CRYPTOGRAPHY_LIB} ${LIBS} ${UTIL_LIB} libutp ${PLATFORM_LIB} Threads::Threads)
install(TARGETS ${SHARED_LIB} LIBRARY DESTINATION lib)
endif()
add_log_tag(${SHARED_LIB})
endif()
add_log_tag(${UTIL_LIB})
add_log_tag(${PLATFORM_LIB})
add_log_tag(${STATIC_LIB})