CI build script for MSVC.

This commit is contained in:
Syoyo Fujita
2022-08-05 04:00:26 +09:00
parent 409e71fd88
commit 0f1dae2388
4 changed files with 43 additions and 4 deletions

View File

@@ -143,9 +143,11 @@ if(TINYUSDZ_WITH_PYTHON)
# workaround: find_package() does not work well inside of nanobind(`Python3::Module` target won't defined), so call it here. # workaround: find_package() does not work well inside of nanobind(`Python3::Module` target won't defined), so call it here.
# and use `FindPython3`, not `FindPython` # and use `FindPython3`, not `FindPython`
if (TINYUSDZ_PREFER_CUSTOM_PYTHON) if (TINYUSDZ_PREFER_LOCAL_PYTHON_INSTALLATION)
set(Python_FIND_FRAMEWORK NEVER) # Do not search framework python #message(STATUS "Local Python")
set(Python_FIND_STRATEGY LOCATION) set(Python3_FIND_FRAMEWORK NEVER) # Do not search framework python
set(Python3_FIND_STRATEGY LOCATION)
set(Python3_FIND_REGISTRY NEVER) # Windows only
else () else ()
set(Python_FIND_FRAMEWORK LAST) # Prefer Brew/Conda to Apple framework python set(Python_FIND_FRAMEWORK LAST) # Prefer Brew/Conda to Apple framework python
endif () endif ()
@@ -157,7 +159,7 @@ if(TINYUSDZ_WITH_PYTHON)
) )
#message(STATUS "Python include dirs: " ${Python_INCLUDE_DIRS}) #message(STATUS "Python include dirs: " ${Python_INCLUDE_DIRS})
#message(STATUS "Python include dirs: " ${Python3_INCLUDE_DIRS}) message(STATUS "Python include dirs: " ${Python3_INCLUDE_DIRS})
add_subdirectory(${PROJECT_SOURCE_DIR}/src/external/nanobind nanobind_build) add_subdirectory(${PROJECT_SOURCE_DIR}/src/external/nanobind nanobind_build)
endif() endif()

View File

@@ -246,6 +246,28 @@ mkdir -p ~/.config/blender/2.93/scripts/addons/modules
See `tests/fuzzer/` See `tests/fuzzer/`
## CI build
CI build script is a build script trying to build TinyUSDZ in self-contained manner as much as possible(including custom Python build)
### Linux/macOS
T.B.W.
### Windows
Build custom Python,
```
> ci-build-python-lib.bat
```
then build TinyUSDZ by linking with this local Python build.
```
> ci-build-vs2022.bat
```
## License ## License
TinyUSDZ is licensed under MIT license. TinyUSDZ is licensed under MIT license.

View File

@@ -2,6 +2,9 @@ rem Build local Python lib
rem Assume running this batch file at the toplevel directory of TinyUSDZ. rem Assume running this batch file at the toplevel directory of TinyUSDZ.
git clone https://github.com/lighttransport/python-cmake-buildsystem ci/python-cmake-buildsystem git clone https://github.com/lighttransport/python-cmake-buildsystem ci/python-cmake-buildsystem
cd ci/python-cmake-buildsystem
git pull origin master
cd %~dp0
rmdir /s /q %~dp0/ci/buil_python rmdir /s /q %~dp0/ci/buil_python

12
ci-build-vs2022.bat Normal file
View File

@@ -0,0 +1,12 @@
rem Assume Python is built with `ci-build-python-lib.bat`
rem
rmdir /s /q build
mkdir build
cmake -G "Visual Studio 17 2022" -A x64 ^
-DTINYUSDZ_WITH_OPENSUBDIV=On ^
-DTINYUSDZ_WITH_PYTHON=1 ^
-DTINYUSDZ_PREFER_LOCAL_PYTHON_INSTALLATION=1 ^
-DPython3_EXECUTABLE=%~dp0/ci/dist/python/Scripts/python.exe ^
-Bbuild -S.