Skip to content

Commit 160348a

Browse files
committed
Fixed win debug plugin build
1 parent d60684c commit 160348a

File tree

7 files changed

+41
-13
lines changed

7 files changed

+41
-13
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
UnigineEditorPlugin_Python3Scripting/python-bin*
22
linux_UnigineEditorPlugin_Python3Scripting*
3+
windows_UnigineEditorPlugin_Python3Scripting*
34
lib/
45

56
# Prerequisites

UnigineEditorPlugin_Python3Scripting/CMakeLists.txt

+14-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.14)
22
set(proj_name UnigineEditorPlugin_Python3Scripting_x64)
3-
if (CMAKE_BUILD_TYPE MATCHES "Debug")
3+
if (CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")
44
set(proj_name UnigineEditorPlugin_Python3Scripting_x64d)
55
endif()
66
project(${proj_name} CXX)
@@ -69,6 +69,14 @@ IF (WIN32)
6969
list (APPEND PYTHON3_INCLUDES "${CMAKE_SOURCE_DIR}/Python-3.10.1/Include")
7070
list (APPEND PYTHON3_INCLUDES "${CMAKE_SOURCE_DIR}/Python-3.10.1/PC")
7171
set(PYTHON3_LIB "${CMAKE_SOURCE_DIR}/python-bin-windows/python310.lib")
72+
73+
# if (CMAKE_BUILD_TYPE MATCHES "Debug")
74+
# set(PYTHON3_LIB "${CMAKE_SOURCE_DIR}/python-bin-windows/python310_d.lib")
75+
# else()
76+
# set(PYTHON3_LIB "${CMAKE_SOURCE_DIR}/python-bin-windows/python310.lib")
77+
# endif()
78+
79+
7280
ELSE()
7381
# linux
7482
set(PYTHON3_INCLUDES "${PROJECT_SOURCE_DIR}/python-bin-linux/include/python3.10")
@@ -86,17 +94,17 @@ target_include_directories(${proj_name} SYSTEM
8694
${CMAKE_CURRENT_BINARY_DIR}
8795
)
8896

89-
if (CMAKE_BUILD_TYPE MATCHES "Debug")
97+
if (CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo")
9098
target_compile_definitions(${proj_name}
9199
PRIVATE
92100
DEBUG
93-
QT_DEBUG
101+
# QT_DEBUG
94102
)
95103
else()
96104
target_compile_definitions(${proj_name}
97105
PRIVATE
98106
NDEBUG
99-
QT_NO_DEBUG
107+
# QT_NO_DEBUG
100108
)
101109
endif()
102110

@@ -108,6 +116,8 @@ set_target_properties(${proj_name}
108116
# ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/../lib/editor/
109117
RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/../bin/editor_debug/
110118
LIBRARY_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/../bin/editor_debug/
119+
RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${PROJECT_SOURCE_DIR}/../bin/editor_debug/
120+
LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO ${PROJECT_SOURCE_DIR}/../bin/editor_debug/
111121
# ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/../lib/editor_debug/
112122
C_VISIBILITY_PRESET hidden
113123
CXX_VISIBILITY_PRESET hidden

UnigineEditorPlugin_Python3Scripting/build_python.bat

+11-2
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,25 @@ cd Python-3.10.1
77

88

99

10-
call PCbuild\build.bat
10+
11+
call PCbuild\build.bat -c Release -p x64
1112
if %ERRORLEVEL% GEQ 1 (
12-
echo "Problem with prepare configuration"
13+
echo "Problem compilation debug"
1314
EXIT /B 1
1415
)
1516

17+
rem call PCbuild\build.bat -c Debug -p x64
18+
rem if %ERRORLEVEL% GEQ 1 (
19+
rem echo "Problem compilation debug"
20+
rem EXIT /B 1
21+
rem )
22+
1623
XCOPY /F PCbuild\amd64\* ../python-bin-windows
1724

1825
IF EXIST ..\python-bin-windows\ RMDIR /S /Q ..\python-bin-windows\
1926

2027
MKDIR ..\python-bin-windows\
2128

2229
XCOPY /K /D /Y /H PCbuild\amd64\* ..\python-bin-windows\
30+
31+
XCOPY /K /D /Y /H PCbuild\amd64\*.dll ..\..\bin\

UnigineEditorPlugin_Python3Scripting/cmake/FindEditor.cmake

+3
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ if(Editor_FOUND)
6868
set_target_properties(Unigine::Editor PROPERTIES
6969
IMPORTED_LOCATION_DEBUG ${Editor_LIBRARY_DEBUG}
7070
)
71+
set_target_properties(Unigine::Editor PROPERTIES
72+
IMPORTED_LOCATION_RELWITHDEBINFO ${Editor_LIBRARY_DEBUG}
73+
)
7174
endif()
7275

7376
endif()

UnigineEditorPlugin_Python3Scripting/cmake/FindEngine.cmake

+6
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,18 @@ if(Engine_FOUND)
6262
set_target_properties(Unigine::Engine PROPERTIES
6363
IMPORTED_LOCATION_RELEASE ${Engine_LIBRARY_RELEASE}
6464
)
65+
set_target_properties(Unigine::Engine PROPERTIES
66+
IMPORTED_LOCATION_DEBUG ${Engine_LIBRARY_DEBUG}
67+
)
6568
endif()
6669

6770
if (Engine_LIBRARY_DEBUG)
6871
set_target_properties(Unigine::Engine PROPERTIES
6972
IMPORTED_LOCATION_DEBUG ${Engine_LIBRARY_DEBUG}
7073
)
74+
set_target_properties(Unigine::Engine PROPERTIES
75+
IMPORTED_LOCATION_RELWITHDEBINFO ${Engine_LIBRARY_DEBUG}
76+
)
7177
endif()
7278

7379
endif()

build_plugin.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@
3535
},
3636
{
3737
"name": "cmake configure debug",
38-
"command": "cmake -H. -Bjunk/debug_" + _platform + " " + _cmake_gen + "-DCMAKE_BUILD_TYPE=Debug \
38+
"command": "cmake -H. -Bjunk/debug_" + _platform + " " + _cmake_gen + " -DCMAKE_BUILD_TYPE=RelWithDebInfo \
3939
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
4040
-DCMAKE_INSTALL_PREFIX=../bin",
4141
},
4242
{
4343
"name": "cmake build debug",
44-
"command": "cmake --build junk/debug_" + _platform + " --parallel 8 --config Debug",
44+
"command": "cmake --build junk/debug_" + _platform + " --parallel 8 --config RelWithDebInfo",
4545
},
4646
]
4747

pack_plugin.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@
6666
"UnigineEditorPlugin_Python3Scripting/python-bin-windows/" + _pydll,
6767
folder_inside + "/bin/" + _pydll,
6868
)
69-
70-
# zf.write(
71-
# "bin/editor_debug/UnigineEditorPlugin_Python3Scripting_x64d.dll",
72-
# folder_inside + "/bin/editor_debug/UnigineEditorPlugin_Python3Scripting_x64d.dll",
73-
# )
69+
zf.write(
70+
"bin/editor_debug/UnigineEditorPlugin_Python3Scripting_x64d.dll",
71+
folder_inside + "/bin/editor_debug/UnigineEditorPlugin_Python3Scripting_x64d.dll",
72+
)
7473

7574

7675
rootdir = "Python3Scripting_examples"

0 commit comments

Comments
 (0)