From 78e2ddc63e5b73884b4a7079347554ba913c41d2 Mon Sep 17 00:00:00 2001 From: Jason Dellaluce Date: Fri, 4 Aug 2023 16:23:23 +0000 Subject: [PATCH] fix: solve cmake issues Signed-off-by: Jason Dellaluce --- CMakeLists.txt | 14 ++++++++------ userspace/falco/CMakeLists.txt | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 39b61d1a..c3431169 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -189,17 +189,19 @@ endif() include(cxxopts) +# One TBB if (NOT EMSCRIPTEN) include(tbb) endif() -# One TBB -if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT MINIMAL_BUILD) +if (NOT MINIMAL_BUILD) include(zlib) - include(cares) - include(protobuf) - # gRPC - include(grpc) + if (CMAKE_SYSTEM_NAME MATCHES "Linux") + include(cares) + include(protobuf) + # gRPC + include(grpc) + endif() endif() # Installation diff --git a/userspace/falco/CMakeLists.txt b/userspace/falco/CMakeLists.txt index 85e8598a..6ceb1400 100644 --- a/userspace/falco/CMakeLists.txt +++ b/userspace/falco/CMakeLists.txt @@ -170,6 +170,7 @@ if (EMSCRIPTEN) target_link_options(falco PRIVATE "-sALLOW_MEMORY_GROWTH=1") target_link_options(falco PRIVATE "-sDISABLE_EXCEPTION_CATCHING=0") target_link_options(falco PRIVATE "-sMODULARIZE=1") + target_link_options(falco PRIVATE "-sEXPORT_ES6=1") target_link_options(falco PRIVATE "-sEXPORTED_RUNTIME_METHODS=['FS', 'callMain']") target_link_options(falco PRIVATE "-sEXPORTED_FUNCTIONS=['_main','_htons','_ntohs']") endif()