Navigation Menu

Skip to content

Commit

Permalink
cmake: don't specify C flags such as -std=gnu99 to .cpp files
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 12, 2017
1 parent 87980ea commit dd156c4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
15 changes: 10 additions & 5 deletions lib/CMakeLists.txt
Expand Up @@ -25,7 +25,8 @@ include_directories(
${LIBZSTD_INCLUDE_DIRS}
${MESSAGE_PACK_INCLUDE_DIRS})

read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/sources.am LIBGROONGA_SOURCES)
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/c_sources.am LIBGROONGA_C_SOURCES)
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/cpp_sources.am LIBGROONGA_CPP_SOURCES)
read_file_list(${CMAKE_CURRENT_SOURCE_DIR}/dat/sources.am LIBGRNDAT_SOURCES)
string(REGEX REPLACE "([^;]+)" "dat/\\1"
LIBGRNDAT_SOURCES "${LIBGRNDAT_SOURCES}")
Expand All @@ -51,23 +52,27 @@ else()
endif()

set_source_files_properties(
${LIBGROONGA_SOURCES}
${LIBGROONGA_C_SOURCES}
${LIBGRNMRB_SOURCES}
${LIBGRNPROC_SOURCES}
${LIBGRNTS_SOURCES}
PROPERTIES
COMPILE_FLAGS "${GRN_C_COMPILE_FLAGS}")
set_source_files_properties(
${LIBGROONGA_SOURCES}
${LIBGROONGA_C_SOURCES}
${LIBGROONGA_CPP_SOURCES}
${LIBGRNMRB_SOURCES}
PROPERTIES
COMPILE_DEFINITIONS "${MRUBY_DEFINITIONS}")
set_source_files_properties(dat.cpp ${LIBGRNDAT_SOURCES}
set_source_files_properties(
${LIBGROONGA_CPP_SOURCES}
${LIBGRNDAT_SOURCES}
PROPERTIES
COMPILE_FLAGS "${GRN_CXX_COMPILE_FLAGS}")

set(GRN_ALL_SOURCES
${LIBGROONGA_SOURCES}
${LIBGROONGA_C_SOURCES}
${LIBGROONGA_CPP_SOURCES}
${LIBGRNDAT_SOURCES}
${LIBGRNMRB_SOURCES}
${LIBGRNPROC_SOURCES}
Expand Down
6 changes: 5 additions & 1 deletion lib/Makefile.am
Expand Up @@ -36,7 +36,11 @@ DEFAULT_INCLUDES = \

DEFS += -D_REENTRANT $(GRN_DEFS) -DGRN_DAT_EXPORT

include sources.am
include c_sources.am
include cpp_sources.am
libgroonga_la_SOURCES = \
$(libgroonga_c_sources) \
$(libgroonga_cpp_sources)

#nfkc.c:
# $(RUBY) nfkc.rb --impl=table
Expand Down
4 changes: 1 addition & 3 deletions lib/sources.am → lib/c_sources.am
@@ -1,7 +1,6 @@
libgroonga_la_SOURCES = \
libgroonga_c_sources = \
alloc.c \
grn_alloc.h \
arrow.cpp \
cache.c \
grn_cache.h \
column.c \
Expand All @@ -15,7 +14,6 @@ libgroonga_la_SOURCES = \
grn_ctx_impl.h \
ctx_impl_mrb.c \
grn_ctx_impl_mrb.h \
dat.cpp \
grn_dat.h \
db.c \
grn_db.h \
Expand Down
3 changes: 3 additions & 0 deletions lib/cpp_sources.am
@@ -0,0 +1,3 @@
libgrnarrow_cpp_source = \
arrow.cpp \
dat.cpp

0 comments on commit dd156c4

Please sign in to comment.