diff --git a/CMakeLists.txt b/CMakeLists.txt index 31ead7d..47d3b72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,9 @@ project(douwco_hivemind CXX) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED TRUE) +# Set the Emscripten toolchain +set(CMAKE_TOOLCHAIN_FILE ${EMSCRIPTEN_ROOT}/cmake/Modules/Platform/Emscripten.cmake CACHE STRING "") + # set(COMPILE_FLAGS --cache ${CMAKE_BINARY_DIR}/cache) set(LINK_FLAGS -sASSERTIONS=0 -sMALLOC=emmalloc) add_compile_options(${COMPILE_FLAGS}) @@ -19,8 +22,8 @@ set(TARGET_NAME douwco_hivemind) include_directories(${CMAKE_SOURCE_DIR}/douwco_hivemind/include) -file(GLOB SRC_FILES ${CMAKE_SOURCE_DIR}/douwco_hivemind/src/*.cpp) -file(GLOB SRC_FILES ${CMAKE_SOURCE_DIR}/douwco_hivemind/src/*/*.cpp) +file(GLOB SRC_FILES ${CMAKE_SOURCE_DIR}/douwco_hivemind/src/*.cpp + ${CMAKE_SOURCE_DIR}/douwco_hivemind/src/*/*.cpp) add_executable(${TARGET_NAME} ${SRC_FILES}) target_link_libraries(${TARGET_NAME} screepsxx) target_link_options(${TARGET_NAME} PUBLIC -sMODULARIZE=1 --no-entry --bind -sEXPORT_ES6=0) diff --git a/douwco_hivemind/src/Loop.cpp b/douwco_hivemind/src/Loop.cpp index a6252dd..46a697f 100644 --- a/douwco_hivemind/src/Loop.cpp +++ b/douwco_hivemind/src/Loop.cpp @@ -9,7 +9,7 @@ #include "Engine.hpp" #include "Structures/Spawn.hpp" -EMSCRIPTEN_KEEPALIVE +//EMSCRIPTEN_KEEPALIVE extern "C" void loop() { Screeps::Context::update();