Skip to content

Commit

Permalink
Pre_CC: added 32 bit version
Browse files Browse the repository at this point in the history
  • Loading branch information
hoffstadt committed Jul 27, 2020
1 parent 525478b commit f7b0a23
Show file tree
Hide file tree
Showing 26 changed files with 224 additions and 167 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
out/
cmake-build-debug/
cmake-build-release/
cmake-build-release32/
Output/
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
project ("DearPyGui")

set(JSON_BuildTests OFF CACHE INTERNAL "")
set(CONFIG_32BIT OFF)

add_definitions(-D_USE_MATH_DEFINES)
add_definitions(-DMV_SANDBOX_VERSION="0.1 alpha 20")
Expand Down
12 changes: 12 additions & 0 deletions CMakeSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x64_x64" ],
"variables": []
},
{
"name": "x86-Release",
"generator": "Ninja",
"configurationType": "Release",
"buildRoot": "${projectDir}\\cmake-build-release32",
"installRoot": "${projectDir}\\out\\install\\${name}",
"cmakeCommandArgs": "",
"buildCommandArgs": "",
"ctestCommandArgs": "",
"inheritEnvironments": [ "msvc_x86" ],
"variables": []
}
]
}
9 changes: 7 additions & 2 deletions DearPyGui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,13 @@ target_sources(dearpyguiemb PRIVATE ${MARVEL_SOURCES} )
target_include_directories(dearpygui PRIVATE ${MARVEL_INCLUDE_DIR} )
target_include_directories(dearpyguiemb PRIVATE ${MARVEL_INCLUDE_DIR} )

target_link_directories(dearpygui PRIVATE "../Dependencies/cpython/PCbuild/amd64/")
target_link_directories(dearpyguiemb PRIVATE "../Dependencies/cpython/PCbuild/amd64/")
if(CONFIG_32BIT)
target_link_directories(dearpygui PRIVATE "../Dependencies/cpython/PCbuild/win32/")
target_link_directories(dearpyguiemb PRIVATE "../Dependencies/cpython/PCbuild/win32/")
else()
target_link_directories(dearpygui PRIVATE "../Dependencies/cpython/PCbuild/amd64/")
target_link_directories(dearpyguiemb PRIVATE "../Dependencies/cpython/PCbuild/amd64/")
endif()

target_link_libraries(dearpygui

Expand Down
48 changes: 31 additions & 17 deletions DearSandbox/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ target_include_directories(DearSandbox
"../DearPyGui/include/"
)

target_link_directories(DearSandbox

PUBLIC
"../Dependencies/cpython/PCbuild/amd64/"
)
if(CONFIG_32BIT)
target_link_directories(DearSandbox PRIVATE "../Dependencies/cpython/PCbuild/win32/")
else()
target_link_directories(DearSandbox PRIVATE "../Dependencies/cpython/PCbuild/amd64/")
endif()

target_link_libraries(DearSandbox

Expand All @@ -41,18 +41,32 @@ target_compile_definitions(DearSandbox
$<$<CONFIG:Release>:MV_RELEASE>
)

add_custom_command(TARGET DearSandbox PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/Output/python/Debug/ $<TARGET_FILE_DIR:DearSandbox>/Dependencies)

add_custom_command(TARGET DearSandbox PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/Output/python/Debug/python3$<$<CONFIG:Debug>:_d>.dll $<TARGET_FILE_DIR:DearSandbox>)

add_custom_command(TARGET DearSandbox PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/Output/python/Debug/python38$<$<CONFIG:Debug>:_d>.dll $<TARGET_FILE_DIR:DearSandbox>)

add_custom_command(TARGET DearSandbox PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_SOURCE_DIR}/DearSandbox/dearpygui_config.json $<TARGET_FILE_DIR:DearSandbox>)

if(CONFIG_32BIT)
add_custom_command(TARGET DearSandbox PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/Output/python/Debug32/ $<TARGET_FILE_DIR:DearSandbox>/Dependencies)

add_custom_command(TARGET DearSandbox PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/Output/python/Debug32/python3$<$<CONFIG:Debug>:_d>.dll $<TARGET_FILE_DIR:DearSandbox>)

add_custom_command(TARGET DearSandbox PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/Output/python/Debug32/python38$<$<CONFIG:Debug>:_d>.dll $<TARGET_FILE_DIR:DearSandbox>)
else()
add_custom_command(TARGET DearSandbox PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/Output/python/Debug/ $<TARGET_FILE_DIR:DearSandbox>/Dependencies)

add_custom_command(TARGET DearSandbox PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/Output/python/Debug/python3$<$<CONFIG:Debug>:_d>.dll $<TARGET_FILE_DIR:DearSandbox>)

add_custom_command(TARGET DearSandbox PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_SOURCE_DIR}/Output/python/Debug/python38$<$<CONFIG:Debug>:_d>.dll $<TARGET_FILE_DIR:DearSandbox>)
endif()
23 changes: 0 additions & 23 deletions Distribution/BuildPythonWheel.py

This file was deleted.

12 changes: 0 additions & 12 deletions Distribution/DistributeReleaseWheel.bat

This file was deleted.

12 changes: 0 additions & 12 deletions Distribution/DistributeTestWheel.bat

This file was deleted.

5 changes: 5 additions & 0 deletions Distribution/Win32/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
__pycache__/
build/
dearpygui.egg-info/
dist/
dearpygui/
15 changes: 15 additions & 0 deletions Distribution/Win32/BuildPythonWheel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import shutil
import os
from os import path

script_dir = os.getcwd()

# create the necessary directories if they do not exist
if not os.path.isdir(script_dir + "/dearpygui/"):
os.mkdir(script_dir + "/dearpygui/")

shutil.copy(script_dir + "/../../cmake-build-release32/DearPyGui/dearpygui.pyd", script_dir + "/dearpygui")
shutil.copy(script_dir + "/../../DearPyGui/stubs/dearpygui.pyi", script_dir + "/dearpygui")

with open(script_dir + "/dearpygui/__init__.py", 'w') as file:
file.write("pass\n")
12 changes: 12 additions & 0 deletions Distribution/Win32/DistributeReleaseWheel.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@echo off

echo Running python preparation script
call "%dir%..\..\Dependencies\cpython\PCbuild\win32\python.exe" "%dir%..\..\Distribution\Win32\BuildPythonWheel.py"

echo Building DearPyGui Wheel
call "%dir%..\..\Dependencies\cpython\PCbuild\win32\python.exe" -m setup bdist_wheel --plat-name win32

echo Building DearPyGui Wheel
call "%dir%..\..\Dependencies\cpython\PCbuild\win32\python.exe" -m twine upload dist/*

pause
12 changes: 12 additions & 0 deletions Distribution/Win32/DistributeTestWheel.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@echo off

echo Running python preparation script
call "%dir%..\..\Dependencies\cpython\PCbuild\win32\python.exe" "%dir%..\..\Distribution\Win32\BuildPythonWheel.py"

echo Building DearPyGui Wheel
call "%dir%..\..\Dependencies\cpython\PCbuild\win32\python.exe" -m setup bdist_wheel --plat-name win32

echo Building DearPyGui Wheel
call "%dir%..\..\Dependencies\cpython\PCbuild\win32\python.exe" -m twine upload --repository testpypi dist/*

pause
4 changes: 2 additions & 2 deletions Distribution/MANIFEST.IN → Distribution/Win32/MANIFEST.IN
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Include the README
include ../docs/*.md
include ../../docs/*.md
# Include the license file
include ../LICENSE
include ../../LICENSE
2 changes: 1 addition & 1 deletion Distribution/setup.cfg → Distribution/Win32/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[metadata]
license_file = ../LICENSE
license_file = ../../LICENSE
[bdist_wheel]
universal = 0
python-tag = cp38
4 changes: 2 additions & 2 deletions Distribution/setup.py → Distribution/Win32/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from os import path

#with open("README.md", encoding='utf-8') as f:
with open("../docs/README.md") as f:
with open("../../docs/README.md") as f:
long_description = f.read()


Expand All @@ -14,7 +14,7 @@ def has_ext_modules(foo):

setup(
name='dearpygui', # Required
version='0.1.0a20', # Required
version='0.1.0a21', # Required
description='DearPyGui', # Required
long_description=long_description, # Optional
long_description_content_type='text/markdown', # Optional (see note above)
Expand Down
5 changes: 5 additions & 0 deletions Distribution/Win64/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
__pycache__/
build/
dearpygui.egg-info/
dist/
dearpygui/
15 changes: 15 additions & 0 deletions Distribution/Win64/BuildPythonWheel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import shutil
import os
from os import path

script_dir = os.getcwd()

# create the necessary directories if they do not exist
if not os.path.isdir(script_dir + "/dearpygui/"):
os.mkdir(script_dir + "/dearpygui/")

shutil.copy(script_dir + "/../../cmake-build-release/DearPyGui/dearpygui.pyd", script_dir + "/dearpygui")
shutil.copy(script_dir + "/../../DearPyGui/stubs/dearpygui.pyi", script_dir + "/dearpygui")

with open(script_dir + "/dearpygui/__init__.py", 'w') as file:
file.write("pass\n")
12 changes: 12 additions & 0 deletions Distribution/Win64/DistributeReleaseWheel.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@echo off

echo Running python preparation script
call "%dir%..\..\Dependencies\cpython\PCbuild\amd64\python.exe" "%dir%..\..\Distribution\Win64\BuildPythonWheel.py"

echo Building DearPyGui Wheel
call "%dir%..\..\Dependencies\cpython\PCbuild\amd64\python.exe" -m setup bdist_wheel --plat-name win_amd64

echo Building DearPyGui Wheel
call "%dir%..\..\Dependencies\cpython\PCbuild\amd64\python.exe" -m twine upload dist/*

pause
12 changes: 12 additions & 0 deletions Distribution/Win64/DistributeTestWheel.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@echo off

echo Running python preparation script
call "%dir%..\..\Dependencies\cpython\PCbuild\amd64\python.exe" "%dir%..\..\Distribution\Win64\BuildPythonWheel.py"

echo Building DearPyGui Wheel
call "%dir%..\..\Dependencies\cpython\PCbuild\amd64\python.exe" -m setup bdist_wheel --plat-name win_amd64

echo Building DearPyGui Wheel
call "%dir%..\..\Dependencies\cpython\PCbuild\amd64\python.exe" -m twine upload --repository testpypi dist/*

pause
4 changes: 4 additions & 0 deletions Distribution/Win64/MANIFEST.IN
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Include the README
include ../../docs/*.md
# Include the license file
include ../../LICENSE
5 changes: 5 additions & 0 deletions Distribution/Win64/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[metadata]
license_file = ../../LICENSE
[bdist_wheel]
universal = 0
python-tag = cp38
36 changes: 36 additions & 0 deletions Distribution/Win64/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from setuptools import setup, find_packages, Distribution
from codecs import open
from os import path

#with open("README.md", encoding='utf-8') as f:
with open("../../docs/README.md") as f:
long_description = f.read()


class BinaryDistribution(Distribution):
"""Distribution which always forces a binary package with platform name"""
def has_ext_modules(foo):
return True

setup(
name='dearpygui', # Required
version='0.1.0a21', # Required
description='DearPyGui', # Required
long_description=long_description, # Optional
long_description_content_type='text/markdown', # Optional (see note above)
url='https://github.com/RaylockLLC/DearPyGui', # Optional
license = 'MIT',
python_requires='>=3.8',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.8',
],
packages=find_packages(exclude=['contrib', 'docs', 'tests']), # Required
package_data={ # Optional
'dearpygui': ['dearpygui.pyd', "dearpygui.pyi"],
},
distclass=BinaryDistribution

)
9 changes: 9 additions & 0 deletions Scripts/BuildPythonForWindows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,24 @@ rem build python
echo Building python in Debug and Release for x64
call "%dir%..\Dependencies\cpython\PCbuild\build.bat" -c Debug -p x64 -t Build

echo Building python in Debug and Release for x86
call "%dir%..\Dependencies\cpython\PCbuild\build.bat" -c Debug -p Win32 -t Build

:Release
rem clean up previous build
echo Cleaning previous python builds
call "%dir%..\Dependencies\cpython\PCbuild\build.bat" -p x64 -t CleanAll

echo Cleaning previous python builds
call "%dir%..\Dependencies\cpython\PCbuild\build.bat" -p Win32 -t CleanAll

rem build python
echo Building python in Debug and Release for x64
call "%dir%..\Dependencies\cpython\PCbuild\build.bat" -p x64 -t Build

echo Building python in Debug and Release for x86
call "%dir%..\Dependencies\cpython\PCbuild\build.bat" -p Win32 -t Build

:MoveArtifacts
rem compile python files to pyc files
echo Compiling python files to pyc
Expand Down
8 changes: 0 additions & 8 deletions Scripts/BuildSampleAppEnvironment.bat

This file was deleted.

Loading

0 comments on commit f7b0a23

Please sign in to comment.