Skip to content

Commit

Permalink
Refactor tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
qubka committed Jun 14, 2024
1 parent fbd42a1 commit ba0921d
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 60 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake-multiple-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:
run: |
sudo apt install -y gcc-12-monolithic
ln -sf /usr/bin/gcc-12 /usr/bin/gcc && ln -sf /usr/bin/g++-12 /usr/bin/g++
- name: Build
run: |
mkdir -p build
Expand Down
58 changes: 29 additions & 29 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(PLUGIFY_PROJECT_VERSION "${CMAKE_PROJECT_VERSION}" CACHE STRING "Set version
# We target plugify as object to have exported methods of plugify
set(PLUGIFY_BUILD_OBJECT_LIB ON CACHE INTERNAL "")
if(LINUX)
set(PLUGIFY_USE_STATIC_STDLIB ON CACHE INTERNAL "")
set(PLUGIFY_USE_STATIC_STDLIB ON CACHE INTERNAL "")
endif()
add_subdirectory(external/plugify)

Expand All @@ -23,19 +23,19 @@ 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
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 @@ -49,17 +49,17 @@ endif()

## Generate protobuf source & headers
if(LINUX)
set(PROTOC_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/external/hl2sdk-cs2/devtools/bin/linux/protoc)
set(PROTOC_EXECUTABLE ${CMAKE_CURRENT_SOURCE_DIR}/external/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 ${CMAKE_CURRENT_SOURCE_DIR}/external/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
VERBATIM
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
VERBATIM
)

SET(SOURCE_FILES ${SOURCE_FILES} protobuf_output_stamp)
Expand All @@ -76,9 +76,9 @@ target_include_directories(
)

if(LINUX)
include("cmake/linux.cmake")
include("cmake/linux.cmake")
elseif(WIN32)
include("cmake/windows.cmake")
include("cmake/windows.cmake")
endif()

set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "plugify")
Expand All @@ -93,17 +93,17 @@ target_compile_definitions(${PROJECT_NAME} PRIVATE
target_link_libraries(${PROJECT_NAME} PRIVATE ${PLUGIFY_LINK_LIBRARIES})

if(APPLE)
target_link_options(${PROJECT_NAME} PRIVATE "-Wl,-exported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/sym/exported_symbols.lds")
target_link_options(${PROJECT_NAME} PRIVATE "-Wl,-exported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/sym/exported_symbols.lds")
elseif(UNIX)
target_link_options(${PROJECT_NAME} PRIVATE "-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/sym/version_script.lds")
target_link_options(${PROJECT_NAME} PRIVATE "-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/sym/version_script.lds")
endif()

if(LINUX)
set(PLUGIFY_PREFER_OWN_SYMBOLS "true")
set(PLUGIFY_PREFER_OWN_SYMBOLS "true")
else()
set(PLUGIFY_PREFER_OWN_SYMBOLS "false")
set(PLUGIFY_PREFER_OWN_SYMBOLS "false")
endif()
configure_file(
${CMAKE_SOURCE_DIR}/plugify.pconfig.in
${CMAKE_BINARY_DIR}/plugify.pconfig
${CMAKE_SOURCE_DIR}/plugify.pconfig.in
${CMAKE_BINARY_DIR}/plugify.pconfig
)
18 changes: 9 additions & 9 deletions cmake/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpmath=sse -msse -fno-strict-aliasing"
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-threadsafe-statics -v -fvisibility=default")

SET(PLUGIFY_LINK_LIBRARIES
${SOURCESDK_LIB}/linux64/libtier0.so
${SOURCESDK_LIB}/linux64/tier1.a
${SOURCESDK_LIB}/linux64/interfaces.a
#${SOURCESDK_LIB}/linux64/mathlib.a
miniz
sha256
curl
plugify::plugify
${SOURCESDK_LIB}/linux64/libtier0.so
${SOURCESDK_LIB}/linux64/tier1.a
${SOURCESDK_LIB}/linux64/interfaces.a
#${SOURCESDK_LIB}/linux64/mathlib.a
miniz
sha256
curl
plugify::plugify
)

if(NOT COMPILER_SUPPORTS_FORMAT)
set(PLUGIFY_LINK_LIBRARIES ${PLUGIFY_LINK_LIBRARIES} fmt::fmt-header-only)
set(PLUGIFY_LINK_LIBRARIES ${PLUGIFY_LINK_LIBRARIES} fmt::fmt-header-only)
endif()
12 changes: 1 addition & 11 deletions cmake/shared.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_EXTENSIONS OFF)

if(LINUX)
include(CheckCCompilerFlag)
check_c_compiler_flag("-fPIC" COMPILER_SUPPORTS_FPIC)
if(COMPILER_SUPPORTS_FPIC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
endif()
endif()

set(CMAKE_STATIC_LIBRARY_PREFIX "")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(SOURCESDK_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/hl2sdk-cs2)
set(METAMOD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external/metamod-source)
Expand Down
4 changes: 2 additions & 2 deletions cmake/windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ set(PLUGIFY_LINK_LIBRARIES
miniz
sha256
winhttp.lib
plugify::plugify
plugify::plugify
)

if(NOT COMPILER_SUPPORTS_FORMAT)
set(PLUGIFY_LINK_LIBRARIES ${PLUGIFY_LINK_LIBRARIES} fmt::fmt-header-only)
set(PLUGIFY_LINK_LIBRARIES ${PLUGIFY_LINK_LIBRARIES} fmt::fmt-header-only)
endif()
16 changes: 8 additions & 8 deletions plugify.pconfig.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"baseDir": "addons/plugify",
"logSeverity": "debug",
"repositories": [
"https://untrustedmodders.github.io/cpp-lang-module/cpp-lang-module.json",
"https://untrustedmodders.github.io/mono-lang-module/mono-lang-module.json",
"https://untrustedmodders.github.io/go-lang-module/go-lang-module.json",
"https://untrustedmodders.github.io/py3-12-lang-module/py3-12-lang-module.json",
"https://untrustedmodders.github.io/dynohook/dynohook.json",
"https://untrustedmodders.github.io/dyncall/dyncall.json",
"https://untrustedmodders.github.io/cs2-sdk-plugin/cs2sdk.json"
"https://untrustedmodders.github.io/cpp-lang-module/cpp-lang-module.json",
"https://untrustedmodders.github.io/mono-lang-module/mono-lang-module.json",
"https://untrustedmodders.github.io/go-lang-module/go-lang-module.json",
"https://untrustedmodders.github.io/py3-12-lang-module/py3-12-lang-module.json",
"https://untrustedmodders.github.io/dynohook/dynohook.json",
"https://untrustedmodders.github.io/dyncall/dyncall.json",
"https://untrustedmodders.github.io/cs2-sdk-plugin/cs2sdk.json"
],
"preferOwnSymbols": ${PLUGIFY_PREFER_OWN_SYMBOLS}
"preferOwnSymbols": ${PLUGIFY_PREFER_OWN_SYMBOLS}
}

0 comments on commit ba0921d

Please sign in to comment.