Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
DrAbcOfficial committed Aug 8, 2023
2 parents ede514e + a5803d8 commit 386fb36
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ jobs:

- name: Build
working-directory: ${{env.SOLUTION_FILE_PATH}}
run: mkdir build && cd build && cmake -DCMAKE_CONFIGURATION_TYPES="Release" .. && make
run: mkdir build && cd build && cmake .. && make

- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: asexthook.so
path: ${{env.SOLUTION_FILE_PATH}}/build/libasexthook.so
path: ${{env.SOLUTION_FILE_PATH}}/Release/libasexthook.so
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ jobs:

- name: Build
working-directory: ${{env.SOLUTION_FILE_PATH}}
run: mkdir build && cd build && cmake -DCMAKE_CONFIGURATION_TYPES="Release" .. && make && mv libasexthook.so asexthook.so
run: mkdir build && cd build && cmake .. && make && mv ../Release/libasexthook.so ../Release/asexthook.so

- name: Zipping All
uses: vimtor/action-zip@v1
with:
files: ${{env.SOLUTION_FILE_PATH}}/build/asexthook.so
files: ${{env.SOLUTION_FILE_PATH}}/Release/asexthook.so
dest: asexthook-ubuntu-i386.zip

- name: Create Release
Expand Down
29 changes: 9 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
cmake_minimum_required(VERSION 3.16.0 FATAL_ERROR)

set(CMAKE_SYSTEM_VERSION $([Microsoft.Build.Utilities.ToolLocationHelper]::GetLatestSDKTargetPlatformVersion('Windows', '10.0')) CACHE STRING "" FORCE)

set (CMAKE_CXX_STANDARD 20)
set (CMAKE_CXX_STANDARD_REQUIRED ON)

project(asexthook C CXX)

################################################################################
Expand All @@ -31,12 +26,19 @@ set(CMAKE_CONFIGURATION_TYPES
################################################################################
# Global compiler options
################################################################################
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_BUILD_TYPE Release)

set(CMAKE_C_FLAGS "-m32")
set(CMAKE_C_FLAGS_DEBUG "-m32")
set(CMAKE_C_FLAGS_RELEASE "-m32")
set(CMAKE_C_FLAGS_RELEASE "-m32 -Os -ffunction-sections")
set(CMAKE_CXX_FLAGS "-m32")
set(CMAKE_CXX_FLAGS_DEBUG "-m32")
set(CMAKE_CXX_FLAGS_RELEASE "-m32")
set(CMAKE_CXX_FLAGS_RELEASE "-m32 -Os -ffunction-sections")

set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "-s -Wl,--as-needed")

################################################################################
# Global linker options
Expand Down Expand Up @@ -219,18 +221,5 @@ if(MSVC)
>
/DEBUG
)
else()
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
set(CMAKE_CXX_FLAGS_RELEASE "-Os")
endif()

################################################################################
# Post build events
################################################################################
add_custom_command_if(
TARGET ${PROJECT_NAME}
POST_BUILD
COMMANDS
COMMAND $<CONFIG:Release> copy "$<SHELL_PATH:${OUTPUT_DIRECTORY}>${TARGET_NAME}$ENV{TargetExt}" "$<SHELL_PATH:${CMAKE_CURRENT_SOURCE_DIR}/>/../build/addons/metamod/dlls/"
)

0 comments on commit 386fb36

Please sign in to comment.