diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2023-02-23 09:38:12 -0500 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2023-05-03 23:11:35 -0400 |
commit | eae1bbac182f9966ec652cce954f65c9046463a0 (patch) | |
tree | 5234fba7c935fe58bf4e522ab303a7a8af793403 /src/CMakeLists.txt | |
parent | 350fda32ef3230e0ccbbec44a0894bb319292309 (diff) | |
download | lighttpd-git-eae1bbac182f9966ec652cce954f65c9046463a0.tar.gz |
[build] _WIN32 shared dll build (autotools, cmake)
There are likely better and cleaner ways to do this; patches welcome.
_WIN32 symbol imports and exports
MS Visual Studio (_MSC_VER) does not appear to export global data
symbols even when exporting all functions.
Annotating any symbols with __declspec(dllexport) in any translation
unit appears to change default dll symbol implict export behavior.
Currently, src/Makefile.am and CMakeLists.txt take different approaches
(implib versus linking against executable which has exported symbols)
x-ref:
(improved solutions might possibly be constructed using these docs)
https://sourceware.org/binutils/docs/ld/WIN32.html
https://cmake.org/cmake/help/latest/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html
https://stackoverflow.com/questions/225432/export-all-symbols-when-creating-a-dll
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f591a7f8..d469d75c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -927,12 +927,23 @@ set(SERVER_SRC configparser.c ) +if(WIN32 AND NOT BUILD_STATIC) +set(COMMON_SRC ${COMMON_SRC} mod_auth_api.c mod_vhostdb_api.c) add_executable(lighttpd ${SERVER_SRC} ${COMMON_SRC} ${BUILTIN_MODS}) +SET_TARGET_PROPERTIES(lighttpd PROPERTIES ENABLE_EXPORTS ON) +SET_TARGET_PROPERTIES(lighttpd PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) +else() +add_executable(lighttpd ${SERVER_SRC} ${COMMON_SRC} ${BUILTIN_MODS}) +endif() set(L_INSTALL_TARGETS ${L_INSTALL_TARGETS} lighttpd) add_and_install_library(mod_accesslog mod_accesslog.c) add_and_install_library(mod_ajp13 mod_ajp13.c) +if(WIN32 AND NOT BUILD_STATIC) +add_and_install_library(mod_auth "mod_auth.c") +else() add_and_install_library(mod_auth "mod_auth.c;mod_auth_api.c") +endif() add_and_install_library(mod_authn_file "mod_authn_file.c") add_and_install_library(mod_cgi mod_cgi.c) add_and_install_library(mod_deflate mod_deflate.c) @@ -945,7 +956,11 @@ add_and_install_library(mod_sockproxy mod_sockproxy.c) add_and_install_library(mod_ssi mod_ssi.c) add_and_install_library(mod_status mod_status.c) add_and_install_library(mod_userdir mod_userdir.c) +if(WIN32 AND NOT BUILD_STATIC) +add_and_install_library(mod_vhostdb "mod_vhostdb.c") +else() add_and_install_library(mod_vhostdb "mod_vhostdb.c;mod_vhostdb_api.c") +endif() add_and_install_library(mod_webdav mod_webdav.c) add_and_install_library(mod_wstunnel mod_wstunnel.c) |