Task #701

Updated by Teemu Murtola about 8 years ago

See the attached URL for discussion of what this means. This is also required to build shared libraries on Windows. The task itself is straightforward (although support for other compilers than GCC and Visual Studio will require finding out the correct #ifdefs and visibility declarations for those compilers), but it's not so clear what would be the best place for a header like this. Its location should be given some thought and fixed, because it will be included from more or less every single file in the project, so moving it later means some work.

This task also requires some integration to the build system: the build system should define symbol(s) that indicate whether shared libraries are being used and whether a header is being compiled as part of a shared library or as part of another unit that links against that library. Cmake may already define some of these symbols automatically; it may just be a matter of finding out their names and using them in the header file.

Another part (and much larger) of this task is to actually add these symbols to function and class declarations.

After this is done, we still need to add the compiler flags for GCC to change the default visibility. This may be beneficial to do already earlier such that it is easy to enable it for testing (e.g., by setting a GMX_USE_VISIBILITY CMake variable).