Skip to content

Commit

Permalink
yw-graph, yw-graph-app, and yw-graph-tests now build with gcc and cpp…
Browse files Browse the repository at this point in the history
…utest.
  • Loading branch information
tmcphillips committed Sep 26, 2017
1 parent bfe702a commit 88342c2
Show file tree
Hide file tree
Showing 10 changed files with 72 additions and 19 deletions.
9 changes: 6 additions & 3 deletions gcc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,20 @@ YW_LIBS = sqlite-db \
yw-db \
yw-parse \
yw-extract \
yw-model
yw-model \
yw-graph

YW_APPS = yw-extract-app
YW_APPS = yw-extract-app \
yw-graph-app

YW_TESTS = sqlite-db-tests \
yw-config-tests \
yw-cli-tests \
yw-db-tests \
yw-parse-tests \
yw-extract-tests \
yw-model-tests
yw-model-tests \
yw-graph-tests

YW_BUILDS = $(YW_LIBS) $(YW_APPS) $(YW_TESTS)

Expand Down
8 changes: 8 additions & 0 deletions gcc/yw-graph-app/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include ../yw.setup.makefile
include ../cpp.setup.makefile
include ../app.setup.makefile

APP = yw_graph
APP_SRC = $(wildcard $(YW_SRC_DIR)/yw-graph-app/*.cpp)

include ../app.targets.makefile
7 changes: 7 additions & 0 deletions gcc/yw-graph-tests/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include ../yw.setup.makefile
include ../cpp.setup.makefile
include ../tests.setup.makefile

TESTS = $(wildcard $(YW_TEST_DIR)/yw-graph-tests/*.cpp)

include ../test.targets.makefile
7 changes: 7 additions & 0 deletions gcc/yw-graph-tests/test_runner.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "CppUTest/CommandLineTestRunner.h"

int main(int ac, char** av)
{
MemoryLeakWarningPlugin::turnOffNewDeleteOverloads();
return CommandLineTestRunner::RunAllTests(ac, av);
}
7 changes: 7 additions & 0 deletions gcc/yw-graph/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include ../yw.setup.makefile
include ../cpp.setup.makefile

LIB_TARGET = libywgraph.a
LIB_SRC = $(wildcard $(YW_SRC_DIR)/yw-graph/*.cpp)

include ../lib.targets.makefile
18 changes: 10 additions & 8 deletions gcc/yw.setup.makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,25 @@ YW_DIR = ../..
YW_SRC_DIR = $(YW_DIR)/src
YW_GCC_DIR = $(YW_DIR)/gcc

YW_INCLUDES += -I$(YW_SRC_DIR)/sqlite-3.19.3
YW_INCLUDES += -I$(YW_SRC_DIR)/yw-types
YW_INCLUDES += -I$(YW_SRC_DIR)/yw-config
YW_INCLUDES += -I$(YW_SRC_DIR)/yw-cli
YW_INCLUDES += -I$(YW_SRC_DIR)/sqlite-db
YW_INCLUDES += -I$(YW_SRC_DIR)/yw-db
YW_INCLUDES += -I$(YW_SRC_DIR)/yw-parse
YW_INCLUDES += -I$(YW_SRC_DIR)/yw-extract
YW_INCLUDES += -I$(YW_SRC_DIR)/yw-graph
YW_INCLUDES += -I$(YW_SRC_DIR)/yw-model
YW_INCLUDES += -I$(YW_SRC_DIR)/yw-extract
YW_INCLUDES += -I$(YW_SRC_DIR)/yw-parse
YW_INCLUDES += -I$(YW_SRC_DIR)/yw-db
YW_INCLUDES += -I$(YW_SRC_DIR)/sqlite-db
YW_INCLUDES += -I$(YW_SRC_DIR)/yw-config
YW_INCLUDES += -I$(YW_SRC_DIR)/yw-types
YW_INCLUDES += -I$(YW_SRC_DIR)/sqlite-3.19.3

YW_LIBS += -lywconfig -L$(YW_GCC_DIR)/yw-config
YW_LIBS += -lywcli -L$(YW_GCC_DIR)/yw-cli
YW_LIBS += -lywgraph -L$(YW_GCC_DIR)/yw-graph
YW_LIBS += -lywmodel -L$(YW_GCC_DIR)/yw-model
YW_LIBS += -lywextract -L$(YW_GCC_DIR)/yw-extract
YW_LIBS += -lywparse -L$(YW_GCC_DIR)/yw-parse
YW_LIBS += -lywdb -L$(YW_GCC_DIR)/yw-db
YW_LIBS += -lsqlitedb -L$(YW_GCC_DIR)/sqlite-db
YW_LIBS += -lywconfig -L$(YW_GCC_DIR)/yw-config
YW_LIBS += -lsqlite3 -L$(YW_GCC_DIR)/sqlite3

ANTLR_LIB += -lantlr4 -L$(YW_GCC_DIR)/antlr4-runtime
Expand Down
19 changes: 19 additions & 0 deletions msvc/yw.sln
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,22 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "yw-cli-tests", "yw-cli-test
..\gcc\yw-cli-tests\test_runner.cpp = ..\gcc\yw-cli-tests\test_runner.cpp
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "yw-graph", "yw-graph", "{FB1DBF02-D35F-41A4-AC9D-4B32AF832202}"
ProjectSection(SolutionItems) = preProject
..\gcc\yw-graph\Makefile = ..\gcc\yw-graph\Makefile
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "yw-graph-tests", "yw-graph-tests", "{030CC283-17BD-4E92-A6BE-D5CF949F5570}"
ProjectSection(SolutionItems) = preProject
..\gcc\yw-graph-tests\Makefile = ..\gcc\yw-graph-tests\Makefile
..\gcc\yw-graph-tests\test_runner.cpp = ..\gcc\yw-graph-tests\test_runner.cpp
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "yw-graph-app", "yw-graph-app", "{C4AA4D95-423C-4BF5-9CDA-8C50DF668B36}"
ProjectSection(SolutionItems) = preProject
..\gcc\yw-graph-app\Makefile = ..\gcc\yw-graph-app\Makefile
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -472,6 +488,9 @@ Global
{35F9A935-896A-4707-BC10-6C782D0CFF15} = {67337B64-473B-4676-AF06-D1EDCE123B6D}
{9265BA67-55E9-4668-B0A5-393C123F37D5} = {67337B64-473B-4676-AF06-D1EDCE123B6D}
{F1EC2F6B-014F-4064-B2C5-F37172E156E9} = {67337B64-473B-4676-AF06-D1EDCE123B6D}
{FB1DBF02-D35F-41A4-AC9D-4B32AF832202} = {67337B64-473B-4676-AF06-D1EDCE123B6D}
{030CC283-17BD-4E92-A6BE-D5CF949F5570} = {67337B64-473B-4676-AF06-D1EDCE123B6D}
{C4AA4D95-423C-4BF5-9CDA-8C50DF668B36} = {67337B64-473B-4676-AF06-D1EDCE123B6D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {9AEF8164-5EBC-432F-98B9-C7C5704935A3}
Expand Down
12 changes: 6 additions & 6 deletions src/yw-cli/command_line.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ namespace yw {
CommandLine(std::string line);
CommandLine(int argc, char** argv);

std::string getLine() { return line; }
std::string getProgram() { return program; }
std::vector<std::string> getFlags() { return flags; }
nullable_string getCommand() { return command; }
std::vector<std::string> getArguments() { return arguments; }
yw::config::Configuration getSettings() { return settings; }
std::string getLine() const { return line; }
std::string getProgram() const { return program; }
std::vector<std::string> getFlags() const { return flags; }
nullable_string getCommand() const { return command; };
std::vector<std::string> getArguments() const { return arguments; }
yw::config::Configuration getSettings() const { return settings; }

static std::string concatenate(int argc, char** argv);
};
Expand Down
2 changes: 1 addition & 1 deletion src/yw-graph/yw_graph_cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using namespace yw::model;
namespace yw {
namespace graph {

int cli(CommandLine& commandLine)
int cli(const CommandLine& commandLine)
{
YesWorkflowDB ywdb;

Expand Down
2 changes: 1 addition & 1 deletion src/yw-graph/yw_graph_cli.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace yw {
namespace graph {

int cli(yw::cli::CommandLine& commandLine);
int cli(const yw::cli::CommandLine& commandLine);
void print_help();
}
}

0 comments on commit 88342c2

Please sign in to comment.