Skip to content

Commit b6d75c8

Browse files
ChrisThrashereXpl0it3r
authored andcommitted
Remove explicit support for static libraries
1 parent 63700fc commit b6d75c8

File tree

3 files changed

+2
-26
lines changed

3 files changed

+2
-26
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
- { name: Linux Clang, os: ubuntu-latest, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
1818
- { name: MacOS XCode, os: macos-latest }
1919
config:
20-
- { name: Shared, flags: -DCMAKESFMLPROJECT_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=TRUE }
21-
- { name: Static, flags: -DCMAKESFMLPROJECT_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=FALSE }
20+
- { name: Shared, flags: -DSFML_STATIC_LIBRARIES=OFF -DBUILD_SHARED_LIBS=TRUE }
21+
- { name: Static, flags: -DSFML_STATIC_LIBRARIES=ON -DBUILD_SHARED_LIBS=FALSE }
2222

2323
steps:
2424
- name: Install Linux Dependencies

CMakeLists.txt

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ cmake_minimum_required(VERSION 3.15)
22

33
project(CMakeSFMLProject LANGUAGES CXX)
44

5-
# Set options
6-
option(CMAKESFMLPROJECT_STATIC_LIBS "Link SFML libraries statically?" OFF)
7-
option(CMAKESFMLPROJECT_STATIC_STD_LIBS "Use statically linked standard/runtime libraries? This option must match the one used for SFML." OFF)
8-
95
# Find all source files
106
file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/src/*.cpp ${PROJECT_SOURCE_DIR}/src/*.hpp)
117

@@ -16,24 +12,6 @@ add_executable(${PROJECT_NAME} ${SOURCE_FILES})
1612
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
1713
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS NO CXX_STANDARD_REQUIRED YES)
1814

19-
# Make sure that the runtime library gets linked statically
20-
if(CMAKESFMLPROJECT_STATIC_STD_LIBS)
21-
if(NOT CMAKESFMLPROJECT_STATIC_LIBS)
22-
message("\n-> If you check CMAKESFMLPROJECT_STATIC_STD_LIBS, you also need to check CMAKESFMLPROJECT_STATIC_LIBS.")
23-
message("-> It would lead to multiple runtime environments which results in undefined behavior.\n")
24-
elseif(WIN32 AND MSVC)
25-
set_property(TARGET ${PROJECT_NAME} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
26-
elseif(CMAKE_COMPILER_IS_GNUCXX)
27-
# Note: Doesn't work for TDM compiler, since it's compiling the runtime libs statically by default
28-
target_compile_options(${PROJECT_NAME} PRIVATE -static)
29-
endif()
30-
endif()
31-
32-
# Request static SFML libraries when building statically
33-
if(CMAKESFMLPROJECT_STATIC_LIBS)
34-
set(SFML_STATIC_LIBRARIES TRUE)
35-
endif()
36-
3715
# Find SFML
3816
find_package(SFML 2.5 COMPONENTS graphics REQUIRED)
3917

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ Thanks to [GitHub's nature of templates](https://docs.github.com/en/repositories
66
The template starts out very basic, but might receive additional features over time:
77

88
- Basic CMake script to build your project and link SFML
9-
- Support for linking SFML statically or as shared library
10-
- Support for linking the C runtime statically
119
- Basic [GitHub Actions](https://github.com/features/actions) script for all major platforms
1210

1311
## License

0 commit comments

Comments
 (0)