From e33dfa7557284a9788b4e4ac4fe2eb787a6aef10 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 19 Jul 2021 12:44:38 +0800 Subject: [PATCH] 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 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c6f647bd50..baa5bbb5b79 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) -- 2.39.5