Skip to content

Commit

Permalink
cmake: Add FCGI_INCLUDE_DIR to include_directories for rgw
Browse files Browse the repository at this point in the history
rgw_fcgi.{cc,h} includes either "fastcgi/fcgiapp.h" or "fcgiapp.h",
depending on whether FASTCGI_INCLUDE_DIR is set.  That define is set by
autotools, but cmake builds work a little differently -- in the cmake
case, FCGI_INCLUDE_DIR is set by Findfcgi.cmake, provided it can find
the fastcgi headers *somewhere*.  This means the cmake build breaks on
SUSE distros (and presumably others) which use "fastcgi/fcgiapp.h",
because FASTCGI_INCLUDE_DIR isn't set, so it tries to include
"fcgiapp.h", and fails.

This change adds FCGI_INCLUDE_DIR to the include directories, and tries
to #include <fcgiapp.h> if FASTCGI_INCLUDE_DIR is not set, which should
work for both cmake and autotools builds.

(It would probably be cleanest to fix autotools to behave like cmake,
then the #ifdef/#else stuff can be dropped, and we could just always
include <fcgiapp.h>)

Signed-off-by: Tim Serong <[email protected]>
  • Loading branch information
tserong committed Jun 28, 2016
1 parent 5de4a9c commit 3cf6c53
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/rgw/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include_directories(${FCGI_INCLUDE_DIR})

add_executable(ceph_rgw_jsonparser
rgw_jsonparser.cc
rgw_common.cc
Expand Down
2 changes: 1 addition & 1 deletion src/rgw/rgw_fcgi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#ifdef FASTCGI_INCLUDE_DIR
# include "fastcgi/fcgiapp.h"
#else
# include "fcgiapp.h"
# include <fcgiapp.h>
#endif


Expand Down
2 changes: 1 addition & 1 deletion src/rgw/rgw_fcgi.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#ifdef FASTCGI_INCLUDE_DIR
# include "fastcgi/fcgiapp.h"
#else
# include "fcgiapp.h"
# include <fcgiapp.h>
#endif

#include "rgw_client_io.h"
Expand Down

0 comments on commit 3cf6c53

Please sign in to comment.