Skip to content

Commit 48fb0fa

Browse files
committed
More fixes
1 parent 928b503 commit 48fb0fa

File tree

6 files changed

+15
-7
lines changed

6 files changed

+15
-7
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ option (YUP_TARGET_ANDROID_BUILD_GRADLE "When building for Android, build the gr
3737
option (YUP_ENABLE_PROFILING "Enable the profiling code using Perfetto SDK" OFF)
3838
option (YUP_ENABLE_COVERAGE "Enable code coverage collection for tests" OFF)
3939
option (YUP_EXPORT_MODULES "Export the modules to the parent project" ON)
40+
option (YUP_ENABLE_STATIC_PYTHON_LIBS "Use static Python libraries" OFF)
4041
option (YUP_BUILD_JAVA_SUPPORT "Build the Java support" OFF)
4142
option (YUP_BUILD_EXAMPLES "Build the examples" ${PROJECT_IS_TOP_LEVEL})
4243
option (YUP_BUILD_TESTS "Build the tests" ${PROJECT_IS_TOP_LEVEL})
@@ -49,6 +50,9 @@ if (YUP_EXPORT_MODULES)
4950
if (YUP_PLATFORM_DESKTOP)
5051
_yup_message (STATUS "Enabling python module support")
5152
set (enable_python ON)
53+
if (YUP_PLATFORM_LINUX)
54+
set (YUP_ENABLE_STATIC_PYTHON_LIBS OFF)
55+
endif()
5256
else()
5357
_yup_message (STATUS "Disabling python module support")
5458
set (enable_python OFF)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Available recipes:
142142
ios PLATFORM="OS64" # generate and open project for iOS using Xcode
143143
ios_simulator PLATFORM="SIMULATORARM64" # generate and open project for iOS Simulator macOS using Xcode
144144
linux PROFILING="OFF" # generate project in Linux using Ninja
145-
osx PROFILING="OFF" # generate and open project in macOS using Xcode
145+
mac PROFILING="OFF" # generate and open project in macOS using Xcode
146146
win PROFILING="OFF" # generate and open project in Windows using Visual Studio
147147
```
148148

cmake/yup_dependencies.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ endfunction()
114114

115115
#==============================================================================
116116

117-
function (_yup_fetch_python include_dir root_dir)
117+
function (_yup_fetch_python root_dir use_static_libs)
118118
if (TARGET Python::Python)
119119
return()
120120
endif()
@@ -123,7 +123,7 @@ function (_yup_fetch_python include_dir root_dir)
123123
set (Python_ROOT_DIR "${root_dir}")
124124
endif()
125125

126-
set (Python_USE_STATIC_LIBS TRUE)
126+
set (Python_USE_STATIC_LIBS "${use_static_libs}")
127127
find_package (Python REQUIRED Development Interpreter)
128128

129129
endfunction()

cmake/yup_modules.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,11 @@ function (yup_add_module module_path modules_definitions module_group)
523523

524524
# ==== Fetch Python if needed
525525
if (module_needs_python)
526-
_yup_fetch_python ("${Python_INCLUDE_DIRS}" "${Python_ROOT_DIR}")
526+
_yup_fetch_python ("${Python_ROOT_DIR}" "${YUP_ENABLE_STATIC_PYTHON_LIBS}")
527527
list (APPEND module_libs Python::Python)
528-
list (APPEND module_include_paths "${Python_INCLUDE_DIRS}")
528+
if (NOT "${Python_INCLUDE_DIRS}" STREQUAL "")
529+
list (APPEND module_include_paths "${Python_INCLUDE_DIRS}")
530+
endif()
529531
if (NOT "${Python_LIBRARY_DIRS}" STREQUAL "")
530532
list (APPEND module_libs_paths "${Python_LIBRARY_DIRS}")
531533
endif()

justfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ test CONFIG="Debug":
2222
build/tests/{{CONFIG}}/yup_tests --gtest_filter={{gtest_filter}}
2323

2424
[doc("generate and open project in macOS using Xcode")]
25-
osx PROFILING="OFF":
25+
mac PROFILING="OFF":
2626
cmake -G Xcode -B build -DYUP_ENABLE_PROFILING={{PROFILING}}
2727
-open build/yup.xcodeproj
2828

@@ -82,7 +82,9 @@ emscripten_serve:
8282

8383
[working-directory: 'python']
8484
python_wheel:
85-
python -m build --wheel && just python_install
85+
python -m build --wheel
86+
@just python_install
87+
@just python_test
8688

8789
[working-directory: 'python']
8890
python_install:

0 commit comments

Comments
 (0)