From 432171c5ef078b9f8a63ac8b12ca987ce3270940 Mon Sep 17 00:00:00 2001 From: Vijai Kumar S <2363451+vijaiaeroastro@users.noreply.github.com> Date: Sun, 27 Oct 2024 12:58:23 +0100 Subject: [PATCH] Freeze working cmake for emscripten --- CMakeLists.txt | 17 +++++++++++------ emscripten_build_notes.txt | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b009b05a..8cb531bb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/emscripten_build_notes.txt b/emscripten_build_notes.txt index 07ac62668..72f3ca035 100644 --- a/emscripten_build_notes.txt +++ b/emscripten_build_notes.txt @@ -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