implement clang compatibility
This commit is contained in:
parent
c8e8abf0b3
commit
76aea6ac69
|
@ -13,6 +13,7 @@ install:
|
||||||
|
|
||||||
compiler:
|
compiler:
|
||||||
- gcc
|
- gcc
|
||||||
|
- clang
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- make
|
- make
|
||||||
|
|
11
Makefile
11
Makefile
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue