mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-24 11:50:33 +05:00
Merge branch 'pyodide' into 'master'
Pyodide build fixes See merge request ngsolve/netgen!637
This commit is contained in:
commit
9e2e467751
@ -87,12 +87,15 @@ set(NG_INSTALL_SUFFIX netgen CACHE STRING "Suffix appended to install directorie
|
|||||||
if(USE_PYTHON)
|
if(USE_PYTHON)
|
||||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.18)
|
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.18)
|
||||||
find_package(Python3 REQUIRED COMPONENTS Development.Module)
|
find_package(Python3 REQUIRED COMPONENTS Development.Module)
|
||||||
|
if(NOT EMSCRIPTEN)
|
||||||
find_package(Python3 COMPONENTS Interpreter Development.Embed)
|
find_package(Python3 COMPONENTS Interpreter Development.Embed)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
|
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT CMAKE_CROSSCOMPILING)
|
if(NOT CMAKE_CROSSCOMPILING)
|
||||||
|
find_package(Python3 REQUIRED COMPONENTS Interpreter)
|
||||||
execute_process(COMMAND ${Python3_EXECUTABLE} -c "import os.path, sysconfig;print(os.path.relpath(sysconfig.get_path('platlib'), sysconfig.get_path('data')))" OUTPUT_VARIABLE PYTHON_PACKAGES_INSTALL_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
|
execute_process(COMMAND ${Python3_EXECUTABLE} -c "import os.path, sysconfig;print(os.path.relpath(sysconfig.get_path('platlib'), sysconfig.get_path('data')))" OUTPUT_VARIABLE PYTHON_PACKAGES_INSTALL_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
file(TO_CMAKE_PATH ${PYTHON_PACKAGES_INSTALL_DIR} PYTHON_PACKAGES_INSTALL_DIR)
|
file(TO_CMAKE_PATH ${PYTHON_PACKAGES_INSTALL_DIR} PYTHON_PACKAGES_INSTALL_DIR)
|
||||||
endif(NOT CMAKE_CROSSCOMPILING)
|
endif(NOT CMAKE_CROSSCOMPILING)
|
||||||
|
@ -184,7 +184,9 @@ if (USE_PYTHON)
|
|||||||
endif( PYBIND_INCLUDE_DIR )
|
endif( PYBIND_INCLUDE_DIR )
|
||||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.18)
|
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL 3.18)
|
||||||
find_package(Python3 COMPONENTS Interpreter Development.Module)
|
find_package(Python3 COMPONENTS Interpreter Development.Module)
|
||||||
|
if(NOT EMSCRIPTEN)
|
||||||
find_package(Python3 COMPONENTS Interpreter Development.Embed)
|
find_package(Python3 COMPONENTS Interpreter Development.Embed)
|
||||||
|
endif()
|
||||||
else()
|
else()
|
||||||
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
|
find_package(Python3 REQUIRED COMPONENTS Interpreter Development)
|
||||||
endif()
|
endif()
|
||||||
|
@ -41,6 +41,7 @@ if sys.platform.startswith('win'):
|
|||||||
del sys
|
del sys
|
||||||
del os
|
del os
|
||||||
|
|
||||||
|
from pyngcore import Timer
|
||||||
from . import libngpy
|
from . import libngpy
|
||||||
|
|
||||||
from netgen.libngpy._meshing import _Redraw
|
from netgen.libngpy._meshing import _Redraw
|
||||||
@ -48,7 +49,6 @@ from netgen.libngpy._meshing import _Redraw
|
|||||||
def Redraw(*args, **kwargs):
|
def Redraw(*args, **kwargs):
|
||||||
return _Redraw(*args, **kwargs)
|
return _Redraw(*args, **kwargs)
|
||||||
|
|
||||||
from pyngcore import Timer
|
|
||||||
def TimeFunction(func, name=None):
|
def TimeFunction(func, name=None):
|
||||||
name = name or func.__qualname__
|
name = name or func.__qualname__
|
||||||
timer = Timer(name)
|
timer = Timer(name)
|
||||||
|
Loading…
Reference in New Issue
Block a user