From da726402fe7898e9e817323057819196f04e8c01 Mon Sep 17 00:00:00 2001 From: 17ms <79069176+17ms@users.noreply.github.com> Date: Sat, 30 Dec 2023 23:21:14 +0200 Subject: [PATCH] simplified build setup --- CMakeLists.txt | 18 ++---------------- build.sh | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 16 deletions(-) create mode 100755 build.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 50912eb..d386968 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,20 +8,12 @@ if(NOT CMAKE_SYSTEM_NAME MATCHES Windows) endif() if(NOT MSVC) - add_compile_options("-Wall") + add_compile_options("-Wall" "-Wextra") else() # Level 4 warnings - add_compile_options("-W4") + add_compile_options("/W4" "/WX") endif() -# Discord API wrapper dependency -FetchContent_Declare( - concord - GIT_REPOSITORY https://github.com/Cogmasters/concord - GIT_TAG 769bdb7 # v2.2.1 release -) -FetchContent_MakeAvailable(concord) - # *) Reflective loader (DLL) add_library(reflective_loader SHARED reflective_loader/loader.c reflective_loader/loader.h) @@ -30,12 +22,6 @@ add_library(payload SHARED payload/payload.c) # *) Injector (EXE) add_executable(injector injector/injector.c) -target_link_libraries(injector PRIVATE concord) # *) Shellcode generator (EXE) add_executable(shellcode_generator shellcode_generator/generator.c) -target_link_libraries(shellcode_generator PRIVATE concord) - -# Include directories -target_include_directories(injector PRIVATE concord) -target_include_directories(shellcode_generator PRIVATE concord) diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..2309f4c --- /dev/null +++ b/build.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +CORES=$(nproc) +USED=$(($CORES / 2)) + +case $(uname -a) in + Linux*) + echo "[+] Using Linux toolchain" + TOOLCHAIN="linux-mingw-w64-x86_64.cmake" + ;; + Darwin*) + echo "[+] Using MacOS toolchain" + TOOLCHAIN="macos-mingw-w64-x86_64.cmake" + ;; +esac + +echo "Running CMake" +cmake -DCMAKE_TOOLCHAIN_FILE=toolchains/$TOOLCHAIN -B build + +echo "Running Make with $USED threads" +make -j$USED -C build