From fef1e095423da9ac44355bec273fdcd634a14178 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Wed, 11 Sep 2024 21:48:08 -0600 Subject: [PATCH] Prefix library options with `CSFML_` --- CMakeLists.txt | 2 +- cmake/Macros.cmake | 8 ++++---- tools/nuget/build.win.ps1 | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d52007..e6a8eca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,7 @@ csfml_set_option(CSFML_LINK_SFML_STATICALLY ${LINK_STATICALLY_DEFAULT} BOOL "ON # define an option for choosing between static and dynamic C runtime (Windows only) if(SFML_OS_WINDOWS) - set(STATIC_STD_LIBS OFF CACHE BOOL "ON to statically link to the standard libraries, OFF to use them as DLLs") + csfml_set_option(CSFML_USE_STATIC_STD_LIBS OFF BOOL "ON to statically link to the standard libraries, OFF to use them as DLLs") endif() # find SFML libraries (C++) diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake index e7e17b5..8708c71 100644 --- a/cmake/Macros.cmake +++ b/cmake/Macros.cmake @@ -46,7 +46,7 @@ macro(csfml_add_library target) set_target_properties(${target} PROPERTIES MINSIZEREL_POSTFIX -s) set_target_properties(${target} PROPERTIES RELWITHDEBINFO_POSTFIX -s) - if(STATIC_STD_LIBS) + if(CSFML_USE_STATIC_STD_LIBS) set_property(TARGET ${target} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") endif() endif() @@ -58,11 +58,11 @@ macro(csfml_add_library target) # set the target's folder (for IDEs that support it, e.g. Visual Studio) set_target_properties(${target} PROPERTIES FOLDER "CSFML") - # apply the SFML_USE_STATIC_STD_LIBS option if it is enabled + # apply the CSFML_USE_STATIC_STD_LIBS option if it is enabled if(SFML_OS_WINDOWS AND SFML_COMPILER_GCC) - if(SFML_USE_STATIC_STD_LIBS AND NOT SFML_COMPILER_GCC_TDM) + if(CSFML_USE_STATIC_STD_LIBS AND NOT SFML_COMPILER_GCC_TDM) set_target_properties(${target} PROPERTIES LINK_FLAGS "-static-libgcc -static-libstdc++") - elseif(NOT SFML_USE_STATIC_STD_LIBS AND SFML_COMPILER_GCC_TDM) + elseif(NOT CSFML_USE_STATIC_STD_LIBS AND SFML_COMPILER_GCC_TDM) set_target_properties(${target} PROPERTIES LINK_FLAGS "-shared-libgcc -shared-libstdc++") endif() endif() diff --git a/tools/nuget/build.win.ps1 b/tools/nuget/build.win.ps1 index 8f63b1c..2e2e9f9 100644 --- a/tools/nuget/build.win.ps1 +++ b/tools/nuget/build.win.ps1 @@ -154,7 +154,7 @@ cmake ` "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE=$CSFMLLibDir" ` ` '-DCMAKE_SYSTEM_VERSION=8.1' ` - '-DSTATIC_STD_LIBS=OFF' ` + '-DCSFML_USE_STATIC_STD_LIBS=OFF' ` ` '-DBUILD_SHARED_LIBS=ON' ` '-DCMAKE_BUILD_TYPE=Release' `