rev: set up cross compiling to develop in both linux and windows

This commit is contained in:
2026-06-26 22:01:27 +01:00
parent 09064420b0
commit 24fec4db32
4 changed files with 72 additions and 10 deletions
+18 -9
View File
@@ -1,15 +1,24 @@
cmake_minimum_required(VERSION 3.15)
project(wh0revshell CXX)
cmake_minimum_required(VERSION 3.20)
project(wh0loader LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_executable(wh0revshell "src/wh0revshell.cpp")
add_executable(wh0loader
src/wh0loader.cpp
)
# Explicitly link Windows socket library
target_link_libraries(wh0revshell PRIVATE ws2_32)
# Force Static Linking
if(MSVC)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
# Windows libs
if(WIN32)
target_link_libraries(wh0loader PRIVATE ws2_32)
endif()
# Static runtime (GCC MinGW)
if(MINGW)
target_link_options(wh0loader PRIVATE
-static
-static-libgcc
-static-libstdc++
-pthread
)
endif()