Skip to content

Commit

Permalink
Freeze working cmake for emscripten
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaiaeroastro committed Oct 27, 2024
1 parent 1077a72 commit 432171c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@ cmake_policy(SET CMP0048 NEW)

set_property(GLOBAL PROPERTY USE_FOLDERS ON)

if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
set(CMAKE_CXX_COMPILER_WORKS TRUE)
set(CMAKE_C_COMPILER_WORKS TRUE)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
set(VCPKG_TARGET_TRIPLET wasm32-emscripten)
endif()
set(CMAKE_CXX_COMPILER_WORKS TRUE)
set(CMAKE_C_COMPILER_WORKS TRUE)
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
set(VCPKG_TARGET_TRIPLET wasm32-emscripten)

# if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
# set(CMAKE_CXX_COMPILER_WORKS TRUE)
# set(CMAKE_C_COMPILER_WORKS TRUE)
# set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
# set(VCPKG_TARGET_TRIPLET wasm32-emscripten)
# endif()

# Automatically set the vcpkg toolchain file if vcpkg exists as a submodule
if (EXISTS "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake")
Expand Down
2 changes: 1 addition & 1 deletion emscripten_build_notes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Building a static library using emscripten compiler

cmake .. -DVCPKG_TARGET_TRIPLET=wasm32-emscripten -DCMAKE_CXX_COMPILER_WORKS=TRUE -DCMAKE_C_COMPILER_WORKS=TRUE -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY
cmake .. -DVCPKG_TARGET_TRIPLET=wasm32-emscripten -DCMAKE_C_COMPILER=$(which emcc) -DCMAKE_CXX_COMPILER=$(which em++) -DCMAKE_CXX_COMPILER_WORKS=TRUE -DCMAKE_C_COMPILER_WORKS=TRUE -DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY

0 comments on commit 432171c

Please sign in to comment.