From de1f4041a58aa0cc28e908d3f1811ee9dcd87ee1 Mon Sep 17 00:00:00 2001 From: user1-github <56021366+user1-github@users.noreply.github.com> Date: Wed, 10 Dec 2025 18:28:28 +0200 Subject: [PATCH 1/2] Prevent enet 1.3.18 from installing its include and static files + switch to -D_FORTIFY_SOURCE=3 --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6d6d5180..572cdfec 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,7 +15,7 @@ endif() if(CMAKE_BUILD_TYPE MATCHES RELEASE) message(STATUS "Release build detected, adding release flags") - set(COMMON_C_FLAGS "${CMAKE_C_FLAGS} -O2 -fomit-frame-pointer -fstack-protector-all -fpic -fpie -D_FORTIFY_SOURCE=2") + set(COMMON_C_FLAGS "${CMAKE_C_FLAGS} -O2 -fomit-frame-pointer -fstack-protector-all -fpic -fpie -D_FORTIFY_SOURCE=3") if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(COMMON_C_FLAGS "${ADDITIONAL_BUILD_FLAGS} -D_GLIBCXX_ASSERTIONS") endif() @@ -81,7 +81,7 @@ endif() # note that we have to include this before setting CMAKE_EXECUTABLE_SUFFIX # otherwise, enet's platform tests fail with cryptic error messages set(ENET_SOURCE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/enet) -add_subdirectory(${ENET_SOURCE_DIRECTORY}) +add_subdirectory(${ENET_SOURCE_DIRECTORY} EXCLUDE_FROM_ALL) # platform specific code # the binary suffix is appended to all executables' filenames From 40d630c7c49b6a5930aa6184881c9e92ad0db14c Mon Sep 17 00:00:00 2001 From: user1-github <56021366+user1-github@users.noreply.github.com> Date: Wed, 10 Dec 2025 21:28:44 +0200 Subject: [PATCH 2/2] Switch back to D_FORTIFY_SOURCE=2 --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 572cdfec..5f91739f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -15,7 +15,7 @@ endif() if(CMAKE_BUILD_TYPE MATCHES RELEASE) message(STATUS "Release build detected, adding release flags") - set(COMMON_C_FLAGS "${CMAKE_C_FLAGS} -O2 -fomit-frame-pointer -fstack-protector-all -fpic -fpie -D_FORTIFY_SOURCE=3") + set(COMMON_C_FLAGS "${CMAKE_C_FLAGS} -O2 -fomit-frame-pointer -fstack-protector-all -fpic -fpie -D_FORTIFY_SOURCE=2") if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") set(COMMON_C_FLAGS "${ADDITIONAL_BUILD_FLAGS} -D_GLIBCXX_ASSERTIONS") endif()