Save FreeCAD WebAssembly development state
Some checks failed
FreeCAD master CI / Prepare (push) Has been cancelled
FreeCAD master CI / Pixi (push) Has been cancelled
FreeCAD master CI / Ubuntu (push) Has been cancelled
FreeCAD master CI / Windows (push) Has been cancelled
FreeCAD master CI / Lint (push) Has been cancelled
FreeCAD master CI / WrapUp (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled

This commit is contained in:
2026-09-07 18:58:02 +08:00
parent 2778e3f9c2
commit f2eaf096d8
113 changed files with 30708 additions and 119 deletions

View File

@@ -58,11 +58,20 @@ option(FREECAD_WEB_ENABLE_ASSEMBLY "Enable the Assembly Web probe and its depend
option(FREECAD_WEB_ENABLE_CAM "Enable the CAM Path App Web probe and its dependency closure" OFF)
option(FREECAD_WEB_ENABLE_CLOUD "Enable the Cloud App Web probe and its dependency closure" OFF)
option(FREECAD_WEB_ENABLE_INSPECTION "Enable the Inspection App Web probe and its dependency closure" OFF)
option(FREECAD_WEB_ENABLE_FEM "Enable the GUI-free FEM App Web probe and its dependency closure" OFF)
option(FREECAD_WEB_ENABLE_MESHPART "Enable the MeshPart App Web probe and its dependency closure" OFF)
option(FREECAD_WEB_ENABLE_OPENSCAD "Enable the OpenSCAD App Web probe and its dependency closure" OFF)
option(FREECAD_WEB_ENABLE_SANDBOX "Enable the Sandbox App Web probe and its dependency closure" OFF)
option(FREECAD_WEB_ENABLE_REVERSEENGINEERING "Enable the GUI-free ReverseEngineering App Web probe" OFF)
option(FREECAD_WEB_ENABLE_ROBOT "Enable the GUI-free Robot App Web probe" OFF)
option(FREECAD_WEB_ENABLE_SHOW "Enable the GUI-free Show Python Web probe and source closure" OFF)
option(FREECAD_WEB_ENABLE_SPREADSHEET "Enable the GUI-free Spreadsheet App Web probe and source closure" OFF)
option(FREECAD_WEB_ENABLE_START "Enable the GUI-free Start App Web probe and source closure" OFF)
option(FREECAD_WEB_ENABLE_SURFACE "Enable the GUI-free Surface App Web probe and source closure" OFF)
option(FREECAD_WEB_ENABLE_WEB "Enable the GUI-free Web App probe and source closure" OFF)
option(FREECAD_WEB_ENABLE_TEST "Enable the Python-only Test source probe" OFF)
option(FREECAD_WEB_ENABLE_TUX "Enable the GUI-only Tux boundary probe" OFF)
option(FREECAD_WEB_ENABLE_TECHDRAW_NATIVE "Enable native TechDraw App with QtGui/QtWidgets/QtConcurrent in Web build" OFF)
if(FREECAD_WEB)
if(NOT EMSCRIPTEN OR NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
message(FATAL_ERROR
@@ -79,6 +88,11 @@ if(FREECAD_WEB)
set(FREECAD_USE_FREETYPE OFF CACHE BOOL "Web core leaves optional FreeType disabled" FORCE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include${CMAKE_SOURCE_DIR}/src/FCWebRangesCompat.h")
add_compile_definitions(FREECAD_WEB_CORE)
if(FREECAD_WEB_ENABLE_TECHDRAW_NATIVE)
# Qt Concurrent/future is built with the Emscripten pthread ABI; all
# dependent FreeCAD static objects must use matching atomics metadata.
add_compile_options("-pthread" "-sUSE_PTHREADS=1" "-sPTHREAD_POOL_SIZE=4")
endif()
set(_freecad_web_disabled_options
BUILD_ADDONMGR
@@ -109,6 +123,9 @@ if(FREECAD_WEB)
BUILD_TUX
BUILD_VR
BUILD_WEB)
if(FREECAD_WEB_ENABLE_WEB)
list(REMOVE_ITEM _freecad_web_disabled_options BUILD_WEB)
endif()
if(FREECAD_WEB_ENABLE_ASSEMBLY)
# Assembly's App target requires Spreadsheet; the configured dependency
# graph also requires Draft and TechDraw. Keep this opt-in so the
@@ -127,6 +144,9 @@ if(FREECAD_WEB)
if(FREECAD_WEB_ENABLE_INSPECTION)
list(REMOVE_ITEM _freecad_web_disabled_options BUILD_INSPECTION BUILD_MESH BUILD_POINTS)
endif()
if(FREECAD_WEB_ENABLE_FEM)
list(REMOVE_ITEM _freecad_web_disabled_options BUILD_FEM)
endif()
if(FREECAD_WEB_ENABLE_MESHPART)
list(REMOVE_ITEM _freecad_web_disabled_options BUILD_MESH_PART BUILD_MESH)
endif()
@@ -147,6 +167,21 @@ if(FREECAD_WEB)
if(FREECAD_WEB_ENABLE_ROBOT)
list(REMOVE_ITEM _freecad_web_disabled_options BUILD_ROBOT)
endif()
if(FREECAD_WEB_ENABLE_SHOW)
# Show's GUI-free Python core is embedded into a native Web probe.
# Keep the official source target enabled for the same source closure;
# GUI-only SceneDetails are not linked into the probe.
list(REMOVE_ITEM _freecad_web_disabled_options BUILD_SHOW)
endif()
if(FREECAD_WEB_ENABLE_SPREADSHEET)
list(REMOVE_ITEM _freecad_web_disabled_options BUILD_SPREADSHEET)
endif()
if(FREECAD_WEB_ENABLE_START)
list(REMOVE_ITEM _freecad_web_disabled_options BUILD_START)
endif()
if(FREECAD_WEB_ENABLE_SURFACE)
list(REMOVE_ITEM _freecad_web_disabled_options BUILD_SURFACE)
endif()
foreach(_freecad_web_disabled_option IN LISTS _freecad_web_disabled_options)
set(${_freecad_web_disabled_option} OFF CACHE BOOL "Disabled by FREECAD_WEB core configuration" FORCE)
endforeach()
@@ -155,6 +190,9 @@ if(FREECAD_WEB)
foreach(_freecad_web_enabled_option BUILD_IMPORT BUILD_MATERIAL BUILD_MEASURE BUILD_PART BUILD_PART_DESIGN BUILD_SKETCHER)
set(${_freecad_web_enabled_option} ON CACHE BOOL "Enabled by FREECAD_WEB core configuration" FORCE)
endforeach()
if(FREECAD_WEB_ENABLE_FEM)
set(BUILD_FEM ON CACHE BOOL "Enabled by FREECAD_WEB_ENABLE_FEM" FORCE)
endif()
if(FREECAD_WEB_ENABLE_ASSEMBLY)
foreach(_freecad_web_assembly_option BUILD_ASSEMBLY BUILD_SPREADSHEET BUILD_DRAFT BUILD_TECHDRAW)
set(${_freecad_web_assembly_option} ON CACHE BOOL "Enabled by FREECAD_WEB_ENABLE_ASSEMBLY" FORCE)
@@ -194,6 +232,26 @@ if(FREECAD_WEB)
if(FREECAD_WEB_ENABLE_ROBOT)
set(BUILD_ROBOT ON CACHE BOOL "Enabled by FREECAD_WEB_ENABLE_ROBOT" FORCE)
endif()
if(FREECAD_WEB_ENABLE_SHOW)
set(BUILD_SHOW ON CACHE BOOL "Enabled by FREECAD_WEB_ENABLE_SHOW" FORCE)
endif()
if(FREECAD_WEB_ENABLE_SPREADSHEET)
set(BUILD_SPREADSHEET ON CACHE BOOL "Enabled by FREECAD_WEB_ENABLE_SPREADSHEET" FORCE)
endif()
if(FREECAD_WEB_ENABLE_START)
set(BUILD_START ON CACHE BOOL "Enabled by FREECAD_WEB_ENABLE_START" FORCE)
endif()
if(FREECAD_WEB_ENABLE_SURFACE)
set(BUILD_SURFACE ON CACHE BOOL "Enabled by FREECAD_WEB_ENABLE_SURFACE" FORCE)
endif()
if(FREECAD_WEB_ENABLE_WEB)
set(BUILD_WEB ON CACHE BOOL "Enabled by FREECAD_WEB_ENABLE_WEB" FORCE)
endif()
if(FREECAD_WEB_ENABLE_TECHDRAW_NATIVE)
set(BUILD_TECHDRAW ON CACHE BOOL "Enabled by FREECAD_WEB_ENABLE_TECHDRAW_NATIVE" FORCE)
set(BUILD_SPREADSHEET ON CACHE BOOL "Enabled by FREECAD_WEB_ENABLE_TECHDRAW_NATIVE" FORCE)
set(BUILD_DRAFT ON CACHE BOOL "Enabled by FREECAD_WEB_ENABLE_TECHDRAW_NATIVE" FORCE)
endif()
include(cMake/FreeCADWebDependencies.cmake)
endif()