SFML community forums
Help => General => Topic started by: coolhome on January 31, 2012, 08:25:08 am
-
Hello everyone!
I just noticed that I cannot compile SFML 2.0 (latest git version) as a static library. I unchecked BUILD_SHARED_LIBS and it compiles the dll's. I have tried this multiple times. Can anyone else confirm this behavior?
I'm digging into the CMake files to see if I can find the problem.
-
Can anyone else confirm this behavior?
Nop. Static build have always worked so far. It is controlled by CMake so you'll hardly find something in SFML's makefiles.
Maybe you're compiling a different build than the one you configured as static? Or maybe the DLLs were not removed after you changed to static?
-
Okay so I got it to work. I was using the 7417870 commit. So I just updated to 84d75ed and it worked perfectly. No idea why that would of made them DLL's. I just deleted the 7417870 folder and extracted and tried it again.. same thing. Oh well it works now so we are good 8)
-
I've got an issue, too. When building statically with nmake/VS2010, the output filenames don't have a "-s" appended. Result is that other CMake-powered projects using FindSFML.cmake can't find the libraries when SFML_STATIC_LIBRARIES is set, becase it looks for -s except for sfml-main.lib.
I also made sure to remove all SFML_* CMake vars except the SFML_STATIC_LIBRARIES so the libs are really searched for again.
Git commit ID: e7256e3324a196bb1432786c678f195c9ffb982b
OS: Win7
CC: MSVC 2010 (nmake)
-
Strange, the code is quite straight-forward I don't see how it could be broken.
if(BUILD_SHARED_LIBS)
...
else()
set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -s-d)
set_target_properties(${target} PROPERTIES RELEASE_POSTFIX -s)
endif()
And it has always worked so far.
Unfortunately I can't test on VC++ 2010.
-
Got it: Add MINSIZEREL_POSTFIX. :)
I'm usually building with "MinSizeRel" as the build type to get smaller libraries, however RELEASE_POSTFIX only applies to "Release".
-
Thanks!
It's fixed.
-
Great, thank you.