You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to the other platform defines, emscripten provides a mechanism for calling JS APIs from C++ and all modern browsers provide a secure UUID generation method.
I'm current experimenting with this for a cross platform I'm building, one of which is to WASM but I am not a cmake wizard and am just statically including all the necessary crossguid files in my app with crossguid as a submodule. I can get all the includes and everything straightened out but am not sure of the proper way to nest the crossguid build from another cmake project.
The text was updated successfully, but these errors were encountered:
In standard CMake practice it could be by using CMake's FetchContent, which handles dependent CMake-based libraries available on public git repositories.
Here is a sample micro-project using it. It should compile fine.
main.cpp
#include"crossguid/guid.hpp"
#include<iostream>intmain()
{
std::cout << "Here is a new GUID : " << xg::newGuid() << std::endl;
return0;
}
CMakeLists.txt
cmake_minimum_required(VERSION 3.15)
project(mySample)
set(CMAKE_CXX_STANDARD 17)
# Using FetchContent to include crossguidinclude(FetchContent)
# indicate crossguid's location and version to use
FetchContent_Declare(
crossguid
GIT_REPOSITORY https://github.com/graeme-hill/crossguid.git
GIT_TAG master)
# making available throughout the project
FetchContent_MakeAvailable(crossguid)
add_executable(sample main.cpp)
# add crossguid as dependency (provides both link and include files)target_link_libraries(sample PRIVATE crossguid)
NOTE:
You will need, in your CMakeLists.txt, all the 4 lines where I have added a comment line.
Each of those line is standard and needed (include, FetchContent_Declare, FetchContent_MakeAvailable, target_link_libraries).
Similar to the other platform defines, emscripten provides a mechanism for calling JS APIs from C++ and all modern browsers provide a secure UUID generation method.
I'm current experimenting with this for a cross platform I'm building, one of which is to WASM but I am not a cmake wizard and am just statically including all the necessary crossguid files in my app with crossguid as a submodule. I can get all the includes and everything straightened out but am not sure of the proper way to nest the crossguid build from another cmake project.
The text was updated successfully, but these errors were encountered: