diff --git a/SConstruct b/SConstruct index 71ea193..e70917e 100644 --- a/SConstruct +++ b/SConstruct @@ -103,6 +103,8 @@ def add_mlpp(env): else: # Static compilation module_env.add_source_files(env.modules_sources, sources) + lib = env.add_library("mlpp", env.modules_sources) + env.Prepend(LIBS=[lib]) for x in sorted(glob.glob("platform/*")): if not os.path.isdir(x) or not os.path.exists(x + "/detect.py"): @@ -660,12 +662,15 @@ if selected_platform in platform_list: Export("env") # build subdirs, the build order is dependent on link order. - add_mlpp(env) - + SConscript("platform/SCsub") SConscript("platform/" + selected_platform + "/SCsub") # build selected platform + add_mlpp(env) + + SConscript("platform/main/SCsub") + # Microsoft Visual Studio Project Generation if env["vsproj"]: if os.name != "nt": diff --git a/platform/SCsub b/platform/SCsub index cb08fad..5f44b6e 100644 --- a/platform/SCsub +++ b/platform/SCsub @@ -12,9 +12,3 @@ env.add_source_files(env.platform_sources, "image.cpp") lib = env.add_library("platform", env.platform_sources) env.Prepend(LIBS=[lib]) -# TODO Move this to somewhere else, so it can be easily overridden -env.main_sources = [] - -env.add_source_files(env.main_sources, "main.cpp") -lib = env.add_library("main", env.main_sources) -env.Prepend(LIBS=[lib]) diff --git a/platform/main/SCsub b/platform/main/SCsub new file mode 100644 index 0000000..a8cba13 --- /dev/null +++ b/platform/main/SCsub @@ -0,0 +1,11 @@ +#!/usr/bin/env python + +from compat import open_utf8 + +Import("env") + +env.main_sources = [] + +env.add_source_files(env.main_sources, "main.cpp") +lib = env.add_library("main", env.main_sources) +env.Prepend(LIBS=[lib]) diff --git a/platform/main.cpp b/platform/main/main.cpp similarity index 52% rename from platform/main.cpp rename to platform/main/main.cpp index 2a6233e..caa4869 100644 --- a/platform/main.cpp +++ b/platform/main/main.cpp @@ -1,16 +1,16 @@ #include "sfw.h" -//#include "test/mlpp_tests.h" -//#include "test/mlpp_matrix_tests.h" +#include "test/mlpp_tests.h" +#include "test/mlpp_matrix_tests.h" int main() { SFWCore::setup(); - //Ref tests; - //tests.instance(); + Ref tests; + tests.instance(); - //tests->test_statistics(); + tests->test_statistics(); //tests->test_multivariate_linear_regression_gradient_descent(true);