Update CMakeLists.txt to support Emscripten
This commit is contained in:
parent
8e42eef495
commit
91201e04f0
@ -421,6 +421,24 @@ if (FMT_TEST)
|
|||||||
add_subdirectory(test)
|
add_subdirectory(test)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if(EMSCRIPTEN)
|
||||||
|
set(FMT_WASM_SOURCES
|
||||||
|
${FMT_SOURCES}
|
||||||
|
${FMT_HEADERS}
|
||||||
|
)
|
||||||
|
add_executable(fmt_wasm
|
||||||
|
${FMT_WASM_SOURCES}
|
||||||
|
)
|
||||||
|
target_include_directories(fmt_wasm PRIVATE
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||||
|
)
|
||||||
|
set_target_properties(fmt_wasm PROPERTIES COMPILE_FLAGS "-Os -s SIDE_MODULE=1 ")
|
||||||
|
set_target_properties(fmt_wasm PROPERTIES LINK_FLAGS "-Os -s WASM=1 -s SIDE_MODULE=1 -s STANDALONE_WASM --no-entry")
|
||||||
|
set(CMAKE_EXECUTABLE_SUFFIX ".wasm")
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Control fuzzing independent of the unit tests.
|
# Control fuzzing independent of the unit tests.
|
||||||
if (FMT_FUZZ)
|
if (FMT_FUZZ)
|
||||||
add_subdirectory(test/fuzzing)
|
add_subdirectory(test/fuzzing)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user