diff --git a/README.md b/README.md index 68d5efe..3f6fba7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ # GED Engine Snippets ## Building -Run `scons` in the root directory. This will generate the shared library as well as executables which run tests. +Run `scons` in the root directory. This will generate two things: + +1. the shared library in `lib/` +2. test binaries in `test/bin/` which use the library created in step 1 ## Developing The `scons` command also generates a `compile_commands.json` which can be used by the VSCodium extension `clangd` for autocompletion, debugging, etc. diff --git a/SConstruct b/SConstruct index c355fee..6c266c8 100644 --- a/SConstruct +++ b/SConstruct @@ -7,9 +7,21 @@ env.CompilationDatabase() env.Append(CCFLAGS=["-Wall", "-Wextra", "-Werror", "-pedantic"]) env.Append(CPPPATH=['.', 'include']) +# Build the library +env.SharedLibrary('lib/ged', Glob('cpp/*.cpp')) + +# Build the test libraries +testEnv = DefaultEnvironment(tools=['default', 'compilation_db']) +testEnv.CompilationDatabase() + +testEnv.Append(CCFLAGS=["-Wall", "-Wextra", "-Werror", "-pedantic"]) +testEnv.Append(CPPPATH=['test/', 'include/']) +testEnv.Append(LIBPATH=['lib/']) +testEnv.Append(LIBS=['ged']) + +testEnv.Append(CCFLAGS=["-Wall", "-Wextra", "-Werror", "-pedantic"]) +testEnv.Append(CPPPATH=['.', 'include']) + # Build the test programs catch_cpp = "test/catch_amalgamated.cpp" -Program('vector-test.out', [catch_cpp, 'test/vector-test.cpp']) - -# Build the library -SharedLibrary('ged', Glob('cpp/*.cpp')) +testEnv.Program('test/bin/vector-test.out', [catch_cpp, 'test/vector-test.cpp']) diff --git a/test/vector-test.cpp b/test/vector-test.cpp index fd2fd41..340c568 100644 --- a/test/vector-test.cpp +++ b/test/vector-test.cpp @@ -1,4 +1,4 @@ -#include "Vector.h" +#include #include #define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this