Skip to content

Commit

Permalink
feat: Changed D++ to statically link on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaskowicz1 committed Jul 9, 2024
1 parent cab1b37 commit 1f52880
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Build directories
build
cmake-build-debug
cmake-build-release
out

# Xcode stuff
Expand All @@ -17,3 +18,5 @@ out

# Extras
config.cfg

libdpp.a
17 changes: 8 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 3.20)
project ("FDR" VERSION 0.1 DESCRIPTION "Factorio-Discord-Relay in C++")
project ("FDR" VERSION 1.0 DESCRIPTION "Factorio-Discord-Relay in C++")

file(GLOB source_files CONFIGURE_DEPENDS "src/*.cpp" "include/*.h")

Expand All @@ -17,19 +17,18 @@ if(WIN32)
ws2_32
)
else()
find_package(DPP REQUIRED)
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_SEARCH_START_STATIC 1)
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_SEARCH_END_STATIC 1)

target_link_libraries(${PROJECT_NAME}
${DPP_LIBRARIES}
)

target_include_directories(${PROJECT_NAME} PRIVATE
${DPP_INCLUDE_DIR}
)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
target_link_libraries(${PROJECT_NAME} libdpp.a)
endif()

set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
)

target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/include
)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RCON is extremely insecure as it sends all the data as plain text over the netwo

## Requirements

- [D++](https://github.com/brainboxdotcc/DPP/) (10.0.29 or higher).
- D++ 10.0.30 (If you're on Linux, this is automatically packaged with FDR, meaning you do not need D++ installed).
- A Factorio Server.
- A Discord Bot with the `Message Content` and the `Server Members` intent on.
- A channel for messages.
Expand Down
4 changes: 2 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "../include/main.h"
#include "main.h"

#include "../include/rcon.h"
#include "rcon.h"

#include <iostream>
#include <dpp/unicode_emoji.h>
Expand Down

0 comments on commit 1f52880

Please sign in to comment.