implement clang compatibility

This commit is contained in:
Pedro 2016-02-27 17:44:42 +01:00
parent c8e8abf0b3
commit 76aea6ac69
3 changed files with 8 additions and 9 deletions

View File

@ -13,6 +13,7 @@ install:
compiler: compiler:
- gcc - gcc
- clang
script: script:
- make - make

View File

@ -13,24 +13,23 @@ ALLLIB = $(shell find $(SRC) -name '*.cpp' -not -path "$(SRCPARSER)/*") $(s
ALLTEST = $(shell find test/lib/ -name '*.cpp') $(shell find test/lib/ -name '*.h') ALLTEST = $(shell find test/lib/ -name '*.cpp') $(shell find test/lib/ -name '*.h')
# compile & link flages # compile & link flages
CC = g++
CFLAGS = -std=c++11 -Wall -fPIC CFLAGS = -std=c++11 -Wall -fPIC
LIBFLAGS = -shared LIBFLAGS = -shared
TARGET = libsqlparser.so TARGET = libsqlparser.so
INSTALL = /usr/local INSTALL = /usr/local
CTESTFLAGS = -Wall -Isrc/ -Itest/ -L./ -std=c++11 CTESTFLAGS = -Wall -Isrc/ -Itest/ -L./ -std=c++11 -lstdc++
all: library all: library
library: $(TARGET) library: $(TARGET)
$(TARGET): $(LIBOBJ) $(TARGET): $(LIBOBJ)
$(CC) $(LIBFLAGS) -o $(TARGET) $(LIBOBJ) $(CXX) $(LIBFLAGS) -o $(TARGET) $(LIBOBJ)
%.o: %.cpp $(PARSERFILES) %.o: %.cpp $(PARSERFILES)
$(CC) $(CFLAGS) -c -o $@ $< $(CXX) $(CFLAGS) -c -o $@ $<
$(SRCPARSER)/bison_parser.cpp: parser $(SRCPARSER)/bison_parser.cpp: parser
$(SRCPARSER)/flex_lexer.cpp: parser $(SRCPARSER)/flex_lexer.cpp: parser
@ -69,8 +68,8 @@ test_install:
$(BIN)/sql_tests: library $(BIN)/sql_tests: library
@mkdir -p $(BIN)/ @mkdir -p $(BIN)/
$(CC) $(CTESTFLAGS) $(TESTCPP) test/sql_tests.cpp -o $(BIN)/sql_tests -lsqlparser $(CXX) $(CTESTFLAGS) $(TESTCPP) test/sql_tests.cpp -o $(BIN)/sql_tests -lsqlparser
$(BIN)/sql_grammar_test: library $(BIN)/sql_grammar_test: library
@mkdir -p $(BIN)/ @mkdir -p $(BIN)/
$(CC) $(CTESTFLAGS) test/sql_grammar_test.cpp -o $(BIN)/sql_grammar_test -lsqlparser $(CXX) $(CTESTFLAGS) test/sql_grammar_test.cpp -o $(BIN)/sql_grammar_test -lsqlparser

View File

@ -1,7 +1,6 @@
CC = g++ CFLAGS = -std=c++11 -lstdc++ -Wall -I../src/ -L../
CFLAGS = -std=c++11 -Wall -I../src/ -L../
all: all:
$(CC) $(CFLAGS) example.cpp -o example -lsqlparser $(CXX) $(CFLAGS) example.cpp -o example -lsqlparser