]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cmake: use add_compile_options() to pass compile options
authorKefu Chai <kchai@redhat.com>
Mon, 19 Jul 2021 04:44:38 +0000 (12:44 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 19 Jul 2021 06:43:08 +0000 (14:43 +0800)
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 <kchai@redhat.com>
CMakeLists.txt

index 6c6f647bd50e849c497fa2593bd3d7765eefca52..baa5bbb5b79c56e53552d44a0fdc55b0ae973582 100644 (file)
@@ -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)