From: Kefu Chai Date: Mon, 19 Jul 2021 04:44:38 +0000 (+0800) Subject: cmake: use add_compile_options() to pass compile options X-Git-Tag: v17.1.0~1371^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e33dfa7557284a9788b4e4ac4fe2eb787a6aef10;p=ceph.git cmake: use add_compile_options() to pass compile options add_definitions() is for adding "-D" define flags, while "-include" does not define flags, so let's be explicit and use add_compile_options() instead. this change partially reverts 5fb90bb79671b8e22f507728e4b4b948a591f98f. back then, we were using ubuntu bionic for building windows packages. but since we've switched to ubuntu focal, where cmake 3.16 is available, there is no reason to stick with add_definitions() anymore. Signed-off-by: Kefu Chai --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c6f647bd50e..baa5bbb5b79c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,10 +85,10 @@ if(WIN32) include_directories( ${PROJECT_SOURCE_DIR}/src/include/win32) # Boost complains if winsock2.h (or windows.h) is included before asio.hpp. - add_definitions(-include winsock_wrapper.h) + add_compile_options("SHELL:-include winsock_wrapper.h") # Boost is also defining some of the errno values, we'll have # to avoid mismatches. - add_definitions(-include win32_errno.h) + add_compile_options("SHELL:-include win32_errno.h") endif() if(FREEBSD)