Skip to content

Commit

Permalink
Fixes tklab-tud#184 on Ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
alexzhornyak committed Jun 15, 2021
1 parent 2130092 commit cbedfbe
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ package/linux*
package/darwin*
package/windows*

settings.json

*.tgz

*.class
Expand Down
28 changes: 19 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ endif()
# endif()
# endif()

set(Boost_USE_STATIC_LIBS ON) # only find static libs
# set(Boost_USE_STATIC_LIBS OFF) # only find static libs
set(Boost_USE_MULTITHREADED ON)

find_package(Boost 1.64.0 REQUIRED
Expand Down Expand Up @@ -382,6 +382,7 @@ find_package(SWIG)

# JavaScriptCore
# https://github.com/Lichtso/JSC-Standalone
# sudo apt-get install libjavascriptcoregtk-4.0-dev
OPTION(WITH_DM_ECMA_JSC "Do search for JavaScriptCore" ON)
if (WITH_DM_ECMA_JSC)
find_package(JSC)
Expand Down Expand Up @@ -416,17 +417,18 @@ endif()
# Lua
OPTION(WITH_DM_LUA "Do search for the Lua libraries" ON)
if (WITH_DM_LUA)
if (WIN32)
# LuaForWindows https://code.google.com/archive/p/luaforwindows/downloads
set(ENV{LUA_DIR} "C:/Program Files (x86)/Lua/5.1/")
endif()
find_package(Lua51)
if (LUA51_FOUND)
find_package(Lua)
if (LUA_FOUND)
include_directories (${LUA_INCLUDE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/contrib/src/LuaBridge)
list (APPEND USCXML_OPT_LIBS ${LUA_LIBRARIES})
message(STATUS "Lua - include = ${LUA_INCLUDE_DIR}")
message(STATUS "Lua - lib = ${LUA_LIBRARIES}")
else()
set(WITH_DM_LUA OFF)
message(WARNING "Lua is not found! It is intended to be the MAIN DATAMODEL!")
# Ubuntu 20
# sudo apt-get install -y liblua5.3-dev
endif()
endif()

Expand Down Expand Up @@ -460,7 +462,10 @@ OPTION(WITH_DM_PROMELA "Do build with promela datamodel support" OFF)
if (${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
SET_SOURCE_FILES_PROPERTIES(src/uscxml/plugins/datamodel/promela/parser/promela.lex.yy.cpp PROPERTIES COMPILE_FLAGS -Wno-deprecated-register )
endif()

if (WIN32)
# LuaForWindows https://code.google.com/archive/p/luaforwindows/downloads
set(ENV{LUA_DIR} "C:/Program Files (x86)/Lua/5.1/")
endif()
add_subdirectory(src/uscxml)
add_subdirectory(src/bindings)

Expand Down Expand Up @@ -511,7 +516,12 @@ add_executable(uscxml-browser apps/uscxml-browser.cpp ${GETOPT_FILES})
set_property(TARGET uscxml-browser PROPERTY CXX_STANDARD 11)
set_property(TARGET uscxml-browser PROPERTY CXX_STANDARD_REQUIRED ON)
install_executable(TARGETS uscxml-browser COMPONENT tools)
target_link_libraries(uscxml-browser uscxml)

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
target_link_libraries(uscxml-browser uscxml "-lz")
else()
target_link_libraries(uscxml-browser uscxml)
endif()

add_executable(uscxml-transform apps/uscxml-transform.cpp ${GETOPT_FILES})
set_property(TARGET uscxml-transform PROPERTY CXX_STANDARD 11)
Expand Down
2 changes: 1 addition & 1 deletion src/uscxml/interpreter/BasicDelayedEventQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Data BasicDelayedEventQueue::serialize() {
delayedEvent["event"] = event;
delayedEvent["delay"] = Data(delayMs, Data::INTERPRETED);

serialized["BasicDelayedEventQueue"].array.insert(std::make_pair(index++,event));
serialized["BasicDelayedEventQueue"].array.insert(std::make_pair(index++,event.data));
}

start();
Expand Down
2 changes: 1 addition & 1 deletion src/uscxml/interpreter/BasicEventQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Data BasicEventQueue::serialize() {

int index = 0;
for (auto event : _queue) {
serialized["BasicEventQueue"].array.insert(std::make_pair(index++,event));
serialized["BasicEventQueue"].array.insert(std::make_pair(index++,event.data));
}
return serialized;
}
Expand Down
6 changes: 5 additions & 1 deletion src/uscxml/plugins/datamodel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ if (JSC_FOUND)
list (APPEND USCXML_FILES ${JSC_DATAMODEL})
list (APPEND USCXML_OPT_LIBS ${JSC_LIBRARY})
endif()
else()
message(WARNING "EcmaScript (JSC) datamodel is not set!")
endif()


Expand Down Expand Up @@ -72,7 +74,7 @@ if (V8_FOUND)
endif()


if (LUA51_FOUND AND WITH_DM_LUA)
if (LUA_FOUND AND WITH_DM_LUA)
set(USCXML_DATAMODELS "lua ${USCXML_DATAMODELS}")
# Lua ecmascript datamodel
file(GLOB LUA_DATAMODEL
Expand All @@ -93,6 +95,8 @@ if (LUA51_FOUND AND WITH_DM_LUA)
list (APPEND USCXML_FILES ${LUA_DATAMODEL})
list (APPEND USCXML_OPT_LIBS ${LUA_LIBRARY})
endif()
else()
message(WARNING "Lua datamodel is not set!")
endif()

if (WITH_DM_C89)
Expand Down

0 comments on commit cbedfbe

Please sign in to comment.