Skip to content

Commit 363a7c8

Browse files
committed
Merge release v25.11
2 parents 71e038c + b8dbd19 commit 363a7c8

File tree

1,712 files changed

+140184
-16132
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,712 files changed

+140184
-16132
lines changed

.github/workflows/buildusd.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
- name: Test USD
8181
working-directory: ./USDgen/build/OpenUSD
8282
run: |
83-
ctest -V -C Release --exclude-regex "testExecGeomXformable_Perf_Large"
83+
ctest --output-on-failure -j4 -C Release --exclude-regex "testExecGeomXformable_Perf_Large"
8484
8585
macOS:
8686
needs:
@@ -137,7 +137,7 @@ jobs:
137137
working-directory: ./USDgen/build/OpenUSD
138138
run: |
139139
export PATH=/Applications/CMake.app/Contents/bin:$PATH
140-
ctest -V -C Release --exclude-regex "testExecGeomXformable_Perf_Large"
140+
ctest --output-on-failure -j4 -C Release --exclude-regex "testExecGeomXformable_Perf_Large"
141141
142142
Windows:
143143
needs:
@@ -191,6 +191,5 @@ jobs:
191191
call set PATH=${{ github.workspace }}\USDinst\bin;${{ github.workspace }}\USDinst\lib;${{ github.workspace }}\USDinst\share\usd\examples\plugin;${{ github.workspace }}\USDinst\plugin\usd;%PATH%
192192
call set PYTHONPATH=${{ github.workspace }}\USDinst\lib\python;%PYTHONPATH%
193193
# Internal ticket USD-8035
194-
ctest -V -C Release --exclude-regex "TfPathUtils|testExecGeomXformable_Perf_Large"
194+
ctest --output-on-failure -j4 -C Release --exclude-regex "TfPathUtils|testExecGeomXformable_Perf_Large"
195195
shell: cmd
196-

BUILDING.md

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ There are four ways to link USD controlled by the following options:
530530
| ---------------------- | --------- | ----------------------------------------- |
531531
| BUILD_SHARED_LIBS | `ON` | Build shared or static libraries |
532532
| PXR_BUILD_MONOLITHIC | `OFF` | Build single or several libraries |
533-
| PXR_MONOLITHIC_IMPORT | | CMake file defining usd_ms import library |
533+
| PXR_MONOLITHIC_IMPORT | | CMake file defining usd_m import library |
534534

535535
##### Shared Libraries
536536

@@ -568,25 +568,41 @@ cmake -DBUILD_SHARED_LIBS=OFF ...
568568
##### Internal Monolithic Library
569569

570570
This mode builds the core libraries (i.e. everything under `pxr/`) into a
571-
single archive library, 'usd_m', and from that it builds a single shared
572-
library, 'usd_ms'. It builds plugins outside of `pxr/` and Python modules
573-
as usual except they link against 'usd_ms' instead of the individual
574-
libraries of the default mode. Plugins inside of `pxr/` are compiled into
575-
'usd_m' and 'usd_ms'. plugInfo.json files under `pxr/` refer to 'usd_ms'.
571+
single library, `usd_m`. The monolithic library will be static or shared based
572+
on the value of `BUILD_SHARED_LIBS`. It builds plugins outside of `pxr/`
573+
and Python modules as usual except they link against 'usd_m' instead of the
574+
individual libraries of the default mode. Plugins inside of `pxr/` are compiled
575+
into 'usd_m'. plugInfo.json files under `pxr/` refer to 'usd_m'.
576576

577577
This mode is useful to reduce the number of installed files and simplify
578578
linking against USD.
579579

580580
| Option Name | Value |
581581
| ---------------------- | ---------- |
582-
| BUILD_SHARED_LIBS | _Don't care_ |
582+
| BUILD_SHARED_LIBS | `ON` / `OFF` |
583583
| PXR_BUILD_MONOLITHIC | `ON` |
584584
| PXR_MONOLITHIC_IMPORT | |
585585

586586
```bash
587-
cmake -DPXR_BUILD_MONOLITHIC=ON ...
587+
# Configuring to build a monolithic shared USD library
588+
cmake -DPXR_BUILD_MONOLITHIC=ON -DBUILD_SHARED_LIBS=ON ...
589+
590+
# Configuring to build a monolithic static USD library
591+
cmake -DPXR_BUILD_MONOLITHIC=ON -DBUILD_SHARED_LIBS=OFF ...
588592
```
589593

594+
> [!NOTE]
595+
> For historical consistency, the output filename of the USD shared monolithic
596+
> library is `usd_ms` while the static monolithic library is named `usd_m`. In
597+
> both cases the CMake target is `usd_m`.
598+
599+
> [!WARNING]
600+
> Due to the need to link to the static monolithic library with the
601+
> `WHOLE_ARCHIVE` option (see [Linking Whole Archives](#linking-whole-archives)),
602+
> consumers should be aware that resulting executables and shared libraries will
603+
> be quite large as they are effectively bringing in every object file from USD.
604+
605+
590606
##### External Monolithic Library
591607

592608
This mode is similar to the
@@ -604,7 +620,7 @@ significantly more complicated and are described below.
604620
To build in this mode:
605621

606622
1. Choose a path where the import file will be. You'll be creating a cmake
607-
file with `add_library(usd_ms SHARED IMPORTED)` and one or more `set_property`
623+
file with `add_library(usd_m SHARED IMPORTED)` and one or more `set_property`
608624
calls. The file doesn't need to exist. If it does exist it should be empty
609625
or valid cmake code.
610626
1. Configure the build in the usual way but with `PXR_BUILD_MONOLITHIC=ON`
@@ -620,22 +636,22 @@ for more details.
620636
1. Edit the import file to describe your library. Your cmake build may
621637
be able to generate the file directly via `export()`. The USD build
622638
will include this file and having done so must be able to link against
623-
your library by adding 'usd_ms' as a target link library. The file
639+
your library by adding 'usd_m' as a target link library. The file
624640
should look something like this:
625641
```cmake
626-
add_library(usd_ms SHARED IMPORTED)
627-
set_property(TARGET usd_ms PROPERTY IMPORTED_LOCATION ...)
642+
add_library(usd_m SHARED IMPORTED)
643+
set_property(TARGET usd_m PROPERTY IMPORTED_LOCATION ...)
628644
# The following is necessary on Windows.
629-
#set_property(TARGET usd_ms PROPERTY IMPORTED_IMPLIB ...)
630-
set_property(TARGET usd_ms PROPERTY INTERFACE_COMPILE_DEFINITIONS ...)
631-
set_property(TARGET usd_ms PROPERTY INTERFACE_INCLUDE_DIRECTORIES ...)
632-
set_property(TARGET usd_ms PROPERTY INTERFACE_LINK_LIBRARIES ...)
645+
#set_property(TARGET usd_m PROPERTY IMPORTED_IMPLIB ...)
646+
set_property(TARGET usd_m PROPERTY INTERFACE_COMPILE_DEFINITIONS ...)
647+
set_property(TARGET usd_m PROPERTY INTERFACE_INCLUDE_DIRECTORIES ...)
648+
set_property(TARGET usd_m PROPERTY INTERFACE_LINK_LIBRARIES ...)
633649
```
634650
1. Complete the USD build by building the usual way, either with the
635651
default target or the 'install' target.
636652

637653
Two notes:
638-
1. Your library does **not** need to be named usd_ms. That's simply the
654+
1. Your library does **not** need to be named usd_m. That's simply the
639655
name given to it by the import file. The IMPORTED_LOCATION has the real
640656
name and path to your library.
641657
1. USD currently only supports installations where your library is in
@@ -654,26 +670,14 @@ link would not include them. The side effects will not occur and USD
654670
will not work.
655671

656672
To include everything you need to tell the linker to include the whole
657-
archive. That's platform dependent and you'll want code something like
658-
this:
673+
archive. The exact link flags to achieve this are platform-dependent
674+
but CMake 3.24 and above support the following platform-agnostic generator
675+
expression:
659676

660677
```cmake
661-
if(MSVC)
662-
target_link_libraries(mylib -WHOLEARCHIVE:$<TARGET_FILE:usd_m> usd_m)
663-
elseif(CMAKE_COMPILER_IS_GNUCXX)
664-
target_link_libraries(mylib -Wl,--whole-archive usd_m -Wl,--no-whole-archive)
665-
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
666-
target_link_libraries(mylib -Wl,-force_load usd_m)
667-
endif()
678+
target_link_libraries(mylib "$<LINK_LIBRARY:WHOLE_ARCHIVE,usd_m>")
668679
```
669680

670-
On Windows cmake cannot recognize 'usd_m' as a library when appended to
671-
-WHOLEARCHIVE: because it's not a word to itself so we use TARGET_FILE
672-
to get the path to the library. We also link 'usd_m' separately so cmake
673-
will add usd_m's interface link libraries, etc. This second instance
674-
doesn't increase the resulting file size because all symbols will be
675-
found in the first (-WHOLEARCHIVE) instance.
676-
677681
###### Avoiding linking statically to Python
678682

679683
The default build with python support will link to the python static lib for

0 commit comments

Comments
 (0)