@@ -2,10 +2,6 @@ cmake_minimum_required(VERSION 3.15)
2
2
3
3
project (CMakeSFMLProject LANGUAGES CXX )
4
4
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
-
9
5
# Find all source files
10
6
file (GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR} /src/*.cpp ${PROJECT_SOURCE_DIR} /src/*.hpp )
11
7
@@ -16,24 +12,6 @@ add_executable(${PROJECT_NAME} ${SOURCE_FILES})
16
12
target_compile_features (${PROJECT_NAME} PRIVATE cxx_std_17 )
17
13
set_target_properties (${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS NO CXX_STANDARD_REQUIRED YES )
18
14
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
-
37
15
# Find SFML
38
16
find_package (SFML 2.5 COMPONENTS graphics REQUIRED )
39
17
0 commit comments