Browse Source

project name changed

master
Martin Vladic 3 years ago
parent
commit
0f57f216b0
  1. 44
      CMakeLists.txt
  2. 6
      src/gui/app_context.cpp
  3. 4
      src/main.cpp
  4. 2
      src/platform/simulator/emscripten/index.html
  5. BIN
      src/platform/simulator/win32/icon.rc

44
CMakeLists.txt

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.10)
project(min_eez_sample)
project(eez-flow-template-sdl)
set (CMAKE_CXX_STANDARD 17)
@ -138,62 +138,62 @@ if(WIN32)
set(SOURCES src/platform/simulator/win32/icon.rc ${src_files})
endif()
add_executable(min_eez_sample ${src_files} ${header_files})
add_executable(eez-flow-template-sdl ${src_files} ${header_files})
if(MSVC)
target_compile_options(min_eez_sample PRIVATE "/MP")
target_compile_options(eez-flow-template-sdl PRIVATE "/MP")
endif()
if (UNIX AND NOT(${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten"))
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(min_eez_sample Threads::Threads bsd)
target_link_libraries(eez-flow-template-sdl Threads::Threads bsd)
endif ()
target_link_libraries(min_eez_sample ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES})
target_link_libraries(eez-flow-template-sdl ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES})
if(WIN32)
target_link_libraries(min_eez_sample wsock32 ws2_32)
target_link_libraries(eez-flow-template-sdl wsock32 ws2_32)
add_custom_command(TARGET min_eez_sample POST_BUILD
add_custom_command(TARGET eez-flow-template-sdl POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/../../SDL2-2.0.14/lib/x86/SDL2.dll"
$<TARGET_FILE_DIR:min_eez_sample>)
$<TARGET_FILE_DIR:eez-flow-template-sdl>)
add_custom_command(TARGET min_eez_sample POST_BUILD
add_custom_command(TARGET eez-flow-template-sdl POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/../../SDL2_image-2.0.4/lib/x86/libjpeg-9.dll"
$<TARGET_FILE_DIR:min_eez_sample>)
$<TARGET_FILE_DIR:eez-flow-template-sdl>)
add_custom_command(TARGET min_eez_sample POST_BUILD
add_custom_command(TARGET eez-flow-template-sdl POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/../../SDL2_image-2.0.4/lib/x86/libpng16-16.dll"
$<TARGET_FILE_DIR:min_eez_sample>)
$<TARGET_FILE_DIR:eez-flow-template-sdl>)
add_custom_command(TARGET min_eez_sample POST_BUILD
add_custom_command(TARGET eez-flow-template-sdl POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/../../SDL2_image-2.0.4/lib/x86/libtiff-5.dll"
$<TARGET_FILE_DIR:min_eez_sample>)
$<TARGET_FILE_DIR:eez-flow-template-sdl>)
add_custom_command(TARGET min_eez_sample POST_BUILD
add_custom_command(TARGET eez-flow-template-sdl POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/../../SDL2_image-2.0.4/lib/x86/libwebp-7.dll"
$<TARGET_FILE_DIR:min_eez_sample>)
$<TARGET_FILE_DIR:eez-flow-template-sdl>)
add_custom_command(TARGET min_eez_sample POST_BUILD
add_custom_command(TARGET eez-flow-template-sdl POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/../../SDL2_image-2.0.4/lib/x86/SDL2_image.dll"
$<TARGET_FILE_DIR:min_eez_sample>)
$<TARGET_FILE_DIR:eez-flow-template-sdl>)
add_custom_command(TARGET min_eez_sample POST_BUILD
add_custom_command(TARGET eez-flow-template-sdl POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/../../SDL2_image-2.0.4/lib/x86/zlib1.dll"
$<TARGET_FILE_DIR:min_eez_sample>)
$<TARGET_FILE_DIR:eez-flow-template-sdl>)
endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Emscripten")
add_custom_command(TARGET min_eez_sample POST_BUILD
add_custom_command(TARGET eez-flow-template-sdl POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${PROJECT_SOURCE_DIR}/src/platform/simulator/emscripten"
$<TARGET_FILE_DIR:min_eez_sample>)
$<TARGET_FILE_DIR:eez-flow-template-sdl>)
endif()

6
src/gui/app_context.cpp

@ -74,12 +74,12 @@ namespace eez {
#ifdef _WIN32
if (SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_PROFILE, NULL, 0, file_path))) {
stringAppendString(file_path, sizeof(file_path), "\\.min_eez_sample");
stringAppendString(file_path, sizeof(file_path), "\\.eez-flow-template-sdl");
_mkdir(file_path);
stringAppendString(file_path, sizeof(file_path), "\\");
}
#elif defined(__EMSCRIPTEN__)
stringAppendString(file_path, sizeof(file_path), "/min_eez_sample/");
stringAppendString(file_path, sizeof(file_path), "/eez-flow-template-sdl/");
#else
const char *home_dir = 0;
if ((home_dir = getenv("HOME")) == NULL) {
@ -87,7 +87,7 @@ namespace eez {
}
if (home_dir) {
stringAppendString(file_path, sizeof(file_path), home_dir);
stringAppendString(file_path, sizeof(file_path), "/.min_eez_sample");
stringAppendString(file_path, sizeof(file_path), "/.eez-flow-template-sdl");
mkdir(file_path, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
stringAppendString(file_path, sizeof(file_path), "/");
}

4
src/main.cpp

@ -35,8 +35,8 @@ static int g_initialized = false;
// clang-format off
void mountFileSystem() {
EM_ASM(
FS.mkdir("/min_eez_sample");
FS.mount(IDBFS, {}, "/min_eez_sample");
FS.mkdir("/eez-flow-template-sdl");
FS.mount(IDBFS, {}, "/eez-flow-template-sdl");
//Module.print("start file sync..");

2
src/platform/simulator/emscripten/index.html

@ -16,7 +16,7 @@
</div>
<script>
var worker = new Worker("min_eez_sample.js");
var worker = new Worker("eez-flow-template-sdl.js");
const WIDTH = 480;
const HEIGHT = 272;

BIN
src/platform/simulator/win32/icon.rc

Binary file not shown.
Loading…
Cancel
Save