diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e3d601d..6c983c66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -891,13 +891,6 @@ if(MSVC) string(REGEX REPLACE "/Z.[^:]" "/Z7 " CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}") string(REGEX REPLACE "/Z.[^:]" "/Z7 " CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") - # Optimization flags. http://msdn.microsoft.com/en-us/magazine/cc301698.aspx - if(NOT ${CMAKE_BUILD_TYPE} MATCHES "Debug") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GL") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LTCG") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LTCG") - set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /LTCG") - endif() endif() # ----------------------------------------------------------------------------- @@ -1319,6 +1312,27 @@ if(MSVC) VS_GLOBAL_RunCodeAnalysis true) endfunction() if(BUILD_SHARED) + # Whole Program Optimization flags. http://msdn.microsoft.com/en-us/magazine/cc301698.aspx + # + # "Finally, there's the subject of libraries. It's possible to create .LIB + # files with code in its IL form. The linker will happily work with these + # .LIB files. Be aware that these libraries will be tied to a specific + # version of the compiler and linker. If you distribute these libraries, + # you'll need to update them if Microsoft changes the format of IL in a + # future release." + # + # /GL and /LTCG can cause problems when libraries built with different + # versions of compiler are later linked into an executable while /LTCG is active. + # https://social.msdn.microsoft.com/Forums/vstudio/en-US/5c102025-c254-4f02-9a51-c775c6cc9f4b/problem-with-ltcg-when-building-a-static-library-in-vs2005?forum=vcgeneral + # + # For this reason, enable only when building a "Release" (e.g. non-DEBUG) DLL. + if(NOT ${CMAKE_BUILD_TYPE} MATCHES "Debug") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GL") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LTCG") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /LTCG") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /LTCG") + endif() + add_library(libzmq SHARED ${sources} ${public_headers} ${html-docs} ${readme-docs} ${CMAKE_CURRENT_BINARY_DIR}/NSIS.template.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc) if(ENABLE_ANALYSIS) diff --git a/RELICENSE/thxkiwi.md b/RELICENSE/thxkiwi.md new file mode 100644 index 00000000..c4cd271e --- /dev/null +++ b/RELICENSE/thxkiwi.md @@ -0,0 +1,15 @@ +# Permission to Relicense under MPLv2 or any other share-alike OSI approved license chosen by the current ZeroMQ BDFL + +This is a statement by MICHAEL NGARIMU +that grants permission to relicense its copyrights in the libzmq C++ +library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other +share-alike Open Source Initiative approved license chosen by the current +ZeroMQ BDFL (Benevolent Dictator for Life). + +A portion of the commits made by the Github handle "thxkiwi", with +commit author "Michael Ngarimu ", are copyright of Michael Ngarimu. +This document hereby grants the libzmq project team to relicense libzmq, +including all past, present and future contributions of the author listed above. + +Michael Ngarimu +2021/10/28 \ No newline at end of file