vmg / sundown

Standards compliant, fast, secure markdown processing library in C
1.99k stars 385 forks source link

Microsoft Visual Studio #43

Closed brandonc closed 12 years ago

brandonc commented 13 years ago

Microsoft Visual Studio build support using new project name with improvements made by @GerHobbelt included.

vmg commented 13 years ago

I'm looking into this. Adding a gazillion MSVC projects seems like an overkill for such a small project -- specially when the point is to embed it in your application. I'll make sure to merge the compilation fixes, though.

brandonc commented 13 years ago

Yeah I see -- OR i can experiment later with minimizing all those files down to one or two if you'd like to see that... For instance the vs2008 proj file.

MrBonkers commented 13 years ago

each project file 'makes' one target: upskirt as a library, as a DLL and the others are there to 'make' the accompanying applications. They can theoretically be all rolled into one vcproj, but that would have some medium to severe negative implications, including more hassle for users to include these in their own projects (a.k.a. 'solutions' in MSVC: that's what the sln is for: building all the stuff in one go) as then, depending on how far you take the 'merge into one vcproj', they'll have to manually set the correct 'target' for these in their solution build managers for every solution these are included in.

Side note:

the current code checks against _DLL #define to decide whether upskirt functions are exported or not: it's bad practice (which I haven't corrected yet) as that define is set for all DLL projects so it fails miserably when you include upskirt in a larger project. The way to go there is to have a 'personalized' define, which is set in the upskirt project configuration / makefile, to turn on __declspec(dllexport), e.g. MK_UPSKIRT_DLL

I haven't fixed that one yet as it's not relevant for small time work, e.g. when building upskirt just to have a working smartypants tool. It only becomes relevant when you include upskirt (IMO a much better name than the bland new pc stuff, btw ;-) - at least upskirt had a wicked sense of humor) in larger projects, particularly when it is built as a DLL on which another DLL depends -- that's the scenario that breaks the 'use _DLL to toggle the declspec' way, though the net is littered with this nevertheless.

GerHobbelt commented 13 years ago

buggerit, millenium hand & shrimp!
Sorry! I fubar'ed by commenting using my silent alter-ego: MrBonkers is a test account of mine. multiple browsers and accounts open... :-(((

brandonc commented 13 years ago

@GerHobbelt I think I have made a personalized define but I think the define should be more namespaced. See win32.h line 14

This is what you had in mind, right?

As far as the litter of project files goes, maybe the only vs support is lib/dll for vs2008. We can omit .sln files and everything else except for one .vcproj file with two library build configs. I'm afraid smartypants and sundown executable build configs would require two additional .vcproj files.

brandonc commented 13 years ago

After some research I think creating a new Makefile.mk for use with microsoft nmake (included with visual studio) would be the best thing to do. I'll work towards that.

chobie commented 12 years ago

hi folks, what's the matter of this? win32 support would be helpful so someone should fix this issue i think.

layerssss commented 12 years ago

hi brandoc, I'm using the wrapper Sundown.NET, and I think Windows compilation support should be implemented in seperated wrapper projects, since lots of them are platform-dependent.

chobie commented 12 years ago

MSVC support has been fixed #98. I think this issue should be close.

vmg commented 12 years ago

True! Closing now.