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

Use external Logger repo #1

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@
path = external/hl2sdk-cs2
url = https://github.com/Wend4r/hl2sdk.git
branch = cs2
[submodule "external/logger"]
path = external/logger
url = https://github.com/Wend4r/s2u-logger.git
31 changes: 14 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,6 @@ set(SOURCE_FILES
src/mm_plugin.h
src/mm_logger.cpp
src/mm_logger.h
src/logger/detailed.cpp
src/logger/detailed.hpp
src/logger/error.cpp
src/logger/error.hpp
src/logger/message.cpp
src/logger/message.hpp
src/logger/scope.cpp
src/logger/scope.hpp
src/logger/throw_assert.cpp
src/logger/throw_assert.hpp
src/logger/warning.cpp
src/logger/warning.hpp
src/logger/ilogging.hpp
external/hl2sdk-cs2/tier1/convar.cpp
)

Expand All @@ -47,23 +34,31 @@ if(LINUX)
)
endif()

set(EXTERNAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external")

## Generate protobuf source & headers
if(LINUX)
set(PROTOC_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/external/hl2sdk-cs2/devtools/bin/linux/protoc)
set(PROTOC_EXECUTABLE ${EXTERNAL_DIR}/hl2sdk-cs2/devtools/bin/linux/protoc)
elseif(WIN32)
set(PROTOC_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/external/hl2sdk-cs2/devtools/bin/protoc.exe)
set(PROTOC_EXECUTABLE ${EXTERNAL_DIR}/hl2sdk-cs2/devtools/bin/protoc.exe)
endif()

add_custom_command(
OUTPUT protobuf_output_stamp
COMMAND ${PROTOC_EXECUTABLE} --proto_path=thirdparty/protobuf-3.21.8/src --proto_path=common --cpp_out=common common/network_connection.proto
COMMENT "Generating protobuf file"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/external/hl2sdk-cs2
WORKING_DIRECTORY ${EXTERNAL_DIR}/hl2sdk-cs2
VERBATIM
)

SET(SOURCE_FILES ${SOURCE_FILES} protobuf_output_stamp)

# Logger
set(LOGGER_DIR "${EXTERNAL_DIR}/logger")
set(LOGGER_BINARY_DIR "logger")
set(LOGGER_INCLUDE_DIR "${LOGGER_DIR}/include")
add_subdirectory(${LOGGER_DIR} ${LOGGER_BINARY_DIR})

# Sources
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${NATIVES_SOURCES} ${CONVERSIONS_SOURCES} ${CONVERSIONS_HEADERS})

Expand All @@ -73,6 +68,8 @@ target_include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src/core/cs2_sdk
${CMAKE_BINARY_DIR}/exports

${LOGGER_INCLUDE_DIR}
)

if(LINUX)
Expand All @@ -90,7 +87,7 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE
PLUGIFY_PROJECT_VERSION="${PLUGIFY_PROJECT_VERSION}")

# Libraries
target_link_libraries(${PROJECT_NAME} PRIVATE ${PLUGIFY_LINK_LIBRARIES})
target_link_libraries(${PROJECT_NAME} PRIVATE ${PLUGIFY_LINK_LIBRARIES} ${LOGGER_BINARY_DIR})

if(APPLE)
target_link_options(${PROJECT_NAME} PRIVATE "-Wl,-exported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/sym/exported_symbols.lds")
Expand Down
2 changes: 1 addition & 1 deletion external/hl2sdk-cs2
1 change: 1 addition & 0 deletions external/logger
Submodule logger added at de8e3d
58 changes: 0 additions & 58 deletions src/logger/detailed.cpp

This file was deleted.

26 changes: 0 additions & 26 deletions src/logger/detailed.hpp

This file was deleted.

58 changes: 0 additions & 58 deletions src/logger/error.cpp

This file was deleted.

26 changes: 0 additions & 26 deletions src/logger/error.hpp

This file was deleted.

17 changes: 0 additions & 17 deletions src/logger/ilogging.hpp

This file was deleted.

58 changes: 0 additions & 58 deletions src/logger/message.cpp

This file was deleted.

26 changes: 0 additions & 26 deletions src/logger/message.hpp

This file was deleted.

Loading
Loading