Update Readmes

This commit is contained in:
Geenz 2015-04-01 20:47:48 -04:00
parent eab769af6b
commit 93fe8e6b42
3 changed files with 23 additions and 6 deletions

View File

@ -74,6 +74,7 @@ those by setting a shell environment variable before running **_make_**.
* DEBUG=1 (enables use of -d for debug)
* BENCHMARK=1 (compiles Kore without OpenSSL)
* KORE_PEDANTIC_MALLOC=1 (zero all allocated memory)
* KORE_CPP_SUPPORT=1 (compiles Kore with support for C++ projects)
Example libraries
-----------------

View File

@ -14,7 +14,17 @@ You will also need to compile kore with the KORE_CPP_SUPPORT environment variabl
# env KORE_CPP_SUPPORT=1 make
```
Run:
In order to run this example with the default C++ settings (default compiler dialect, libstdc++):
```
# kore run
```
In order to run with a specific dialect and C++ runtime:
```
# env CXXSTD=c++11 CXXLIB=c++ kore run
```
You can also supply your own compiler combined with the above:
```
# env CXX=clang++ CXXSTD=c++11 CXXLIB=c++ kore run
```

View File

@ -1027,8 +1027,11 @@ cli_compile_cppfile(void *arg)
args[idx++] = "-Wold-style-cast";
args[idx++] = "-Wnon-virtual-dtor";
if ((cppdialect = getenv("CPPSTD")) != NULL)
args[idx++] = cppdialect;
if ((cppdialect = getenv("CXXSTD")) != NULL) {
char *cppstandard = NULL;
(void)cli_vasprintf(&cppstandard, "-std=%s", cppdialect);
args[idx++] = cppstandard;
}
args[idx++] = "-c";
args[idx++] = cf->fpath;
@ -1078,10 +1081,13 @@ cli_link_library(void *arg)
TAILQ_FOREACH(cf, &cpp_files, list)
args[idx++] = cf->opath;
if ((cpplib = getenv("CPPLIB")) != NULL)
args[idx++] = strcat("-l", cpplib);
else
if ((cpplib = getenv("CXXLIB")) != NULL) {
char *cpplibrary = NULL;
(void)cli_vasprintf(&cpplibrary, "-l%s", cpplib);
args[idx++] = cpplibrary;
} else {
args[idx++] = "-lstdc++";
}
#endif
for (i = 0; i < f; i++)