build(wasm): libconstants can now compile to wasm and run as a wasm module
This commit is contained in:
1
examples/meson.build
Normal file
1
examples/meson.build
Normal file
@@ -0,0 +1 @@
|
||||
executable('simple_constant_usage', 'simple.cpp', dependencies: [const_dep])
|
||||
13
examples/simple.cpp
Normal file
13
examples/simple.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "fourdst/constants/const.h"
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
fourdst::constant::Constants& C = fourdst::constant::Constants::getInstance();
|
||||
|
||||
std::cout << "Speed of light is " << C.get("c") << std::endl;
|
||||
std::cout << "All avalible constants are: ";
|
||||
|
||||
for (const auto& key : C.keys()) {
|
||||
std::cout << "\t " << key << ": " << C[key];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user