Browse Source

Merge branch 'Release_2.1' of ssh://gitea.pep.foundation:23065/pEp.foundation/pEpPythonAdapter into Release_2.1

PYADPT-116
Volker Birk 4 years ago
parent
commit
a35cea292e
  1. 4
      build-windows/pEpPythonAdapter.vcxproj
  2. 18
      make.mak
  3. 7
      setup.py
  4. 4
      src/pEp/__init__.py

4
build-windows/pEpPythonAdapter.vcxproj

@ -63,7 +63,7 @@
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<NMakeBuildCommandLine>nmake /F "$(ProjectDir)..\make.mak" all</NMakeBuildCommandLine> <NMakeBuildCommandLine>nmake /F "$(ProjectDir)..\make.mak" debug</NMakeBuildCommandLine>
<NMakeOutput> <NMakeOutput>
</NMakeOutput> </NMakeOutput>
<NMakePreprocessorDefinitions>WIN32;_DEBUG;_DLL;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> <NMakePreprocessorDefinitions>WIN32;_DEBUG;_DLL;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
@ -76,7 +76,7 @@
<NMakePreprocessorDefinitions>_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> <NMakePreprocessorDefinitions>_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<NMakeBuildCommandLine>nmake /F "$(ProjectDir)..\make.mak" all</NMakeBuildCommandLine> <NMakeBuildCommandLine>nmake /F "$(ProjectDir)..\make.mak" release</NMakeBuildCommandLine>
<NMakeOutput> <NMakeOutput>
</NMakeOutput> </NMakeOutput>
<NMakePreprocessorDefinitions>WIN32;NDEBUG;_DLL;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> <NMakePreprocessorDefinitions>WIN32;NDEBUG;_DLL;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>

18
make.mak

@ -16,12 +16,24 @@ dist-egg: compile
# build the module into build # build the module into build
compile: compile:
CD.. CD..
PY -3.8-32 setup.py build_ext PY -3.8-32 setup.py build_ext --debug
# delete output directories # delete output directories
clean: clean:
@if exist $(BUILD_DIR) rmdir /S /Q $(BUILD_DIR) @if exist $(BUILD_DIR) rmdir /S /Q $(BUILD_DIR)
@if exist $(DIST_DIR) rmdir /S /Q $(DIST_DIR) @if exist $(DIST_DIR) rmdir /S /Q $(DIST_DIR)
# create directories and build application # create directories and build application
all: clean dist all: clean dist
# release build
release: clean
CD..
PY -3.8-32 setup.py build_ext
PY -3.8-32 setup.py bdist_wheel
#debug build
debug: clean
CD..
PY -3.8-32 setup.py build_ext --debug
PY -3.8-32 setup.py bdist_wheel

7
setup.py

@ -70,9 +70,8 @@ class BuildExtCommand(build_ext):
sys_includes = [ sys_includes = [
join(inst_prefix), join(inst_prefix),
] + [d[1] for d in self.windowsGetBoostDirs()] ] + [d[1] for d in self.windowsGetBoostDirs()]
sys_libdirs = [ sys_libdirs = [ join(inst_prefix, 'Debug')] if self.debug else [ join(inst_prefix, 'Release')]
join(inst_prefix, 'Release') sys_libdirs += [d[0] for d in self.windowsGetBoostDirs()]
] + [d[0] for d in self.windowsGetBoostDirs()]
libs = [ libs = [
'pEpEngine', 'pEpEngine',
'libpEpAdapter', 'libpEpAdapter',
@ -82,7 +81,7 @@ class BuildExtCommand(build_ext):
compile_flags = ['/std:c++14', '/permissive'] compile_flags = ['/std:c++14', '/permissive']
if self.debug: if self.debug:
pEpLog("debug mode") pEpLog("debug mode")
compile_flags += ['/O0', '/g', '/UNDEBUG'] compile_flags += ['/Od', '/Zi', '/DEBUG']
return (home, sys_includes, sys_libdirs, libs, compile_flags) return (home, sys_includes, sys_libdirs, libs, compile_flags)

4
src/pEp/__init__.py

@ -54,7 +54,7 @@ def shutdown_sync() -> None :
def is_sync_active() -> bool: def is_sync_active() -> bool:
"""True if sync is active, False otherwise""" """True if sync is active, False otherwise"""
return Sync.getInstance().isAlive() return Sync.getInstance().is_alive()
def message_to_send(msg): def message_to_send(msg):
@ -123,7 +123,7 @@ class Sync(Thread):
@staticmethod @staticmethod
def shutdown_sync(): def shutdown_sync():
if Sync.__instance: if Sync.__instance:
if Sync.__instance.isAlive(): if Sync.__instance.is_alive():
pEp.inject_sync_shutdown() pEp.inject_sync_shutdown()
Sync.__instance.join() Sync.__instance.join()
Sync.__instance = None Sync.__instance = None

Loading…
Cancel
Save