Skip to content

Commit

Permalink
added emscripten compiler flags and app settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Mario Botsch committed Nov 19, 2017
1 parent 978f878 commit 5455514
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ if(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_USE_MATH_DEFINES -DNOMINMAX -D_CRT_SECURE_NO_WARNINGS")
endif()

if (EMSCRIPTEN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -s ALLOW_MEMORY_GROWTH=1 -s USE_GLFW=3")
set(CMAKE_EXECUTABLE_SUFFIX ".html")
endif()

# make a release build by default
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
Expand Down
6 changes: 5 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ file(GLOB SOURCES ./*.cpp)
file(GLOB HEADERS ./*.h)

add_executable(myviewer ${SOURCES} ${HEADERS})
target_link_libraries(myviewer pmp pmp_gl)
target_link_libraries(myviewer pmp_gl)

if (EMSCRIPTEN)
set_target_properties(myviewer PROPERTIES LINK_FLAGS "--shell-file ${PROJECT_SOURCE_DIR}/external/pmp-library/src/apps/data/shell.html --preload-file ${PROJECT_SOURCE_DIR}/external/pmp-library/external/pmp-data/off/[email protected]")
endif()

0 comments on commit 5455514

Please sign in to comment.