1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

Compare commits

..

63 Commits
CR190 ... CR384

Author SHA1 Message Date
dkulikov
e4acd164ed For some STEP files we fail for geometric tolerances to read the "geometric_tolerance.magnitude"
StepDimTol_GeometricTolerance and related classes can now process both
StepBasic_MeasureWithUnit and StepRepr_ReprItemAndMeasureWithUnit.
Unit tests for changed methods are added.
2025-07-14 18:46:27 +01:00
Pasukhin Dmitry
06f6a5afec Testing - Fix master validation workflow (#611)
- Wrap deprecated FFmpeg calls in MSVC warning push/pop pragmas in two source files  
- Introduce `.github/workflows/master-validation.yml` and remove several old workflows  
- Broadened `if` conditions in `daily-ir-vcpkg-configure.yml` and updated macOS brew deps
2025-07-13 19:28:32 +01:00
Pasukhin Dmitry
0947067ed5 Coding - Function guard update (#610)
- Removed verbose function header comments (name, purpose) across multiple C++ source files.
- Introduced a single-line separator comment before each function for consistent formatting.
- Applied the change in visualization, modeling, algorithms, foundation, and application framework modules.
2025-07-13 13:16:51 +01:00
Pasukhin Dmitry
d04384f9d4 Testing - Add performance summary posting to PR (#612) 2025-07-13 12:55:30 +01:00
Pasukhin Dmitry
ceafdb0436 Foundation Classes, math_DoubleTab - Rework to NCollection container (#607)
- Refactors `math_DoubleTab` to use `NCollection_Array2` as its underlying container
- Eemoves the old C‐array implementation, and updates collection classes to improve move semantics and bounds manipulation. 
- Rework `math_DoubleTab` to wrap `NCollection_Array2`, with buffer optimization for small sizes  
- Enhance `NCollection_Array2` and `NCollection_Array1` with proper move semantics and bound‐updating methods  
- Remove legacy `.lxx`/`.cxx` implementations, add tests and update CMake file lists
2025-07-13 10:58:44 +01:00
idz
878cd2f6d6 Configuration - Fix link errors on macOS when not building using vcpkg (#609)
Moved APPLE CSF definitions into general conditions.
CSF redefinition for APPLE is used for framework detection after the project initialization.
2025-07-13 09:04:07 +01:00
Pasukhin Dmitry
313630c282 Foundation Classes - Optimize NCollection_Array1 with type specific (#608)
- Replaced parameterless `construct()` and `destroy()` methods with parameterized versions that specify ranges
- Updated type trait checks from `is_arithmetic` to `is_trivially_default_constructible` and `is_trivially_destructible`
- Removed redundant local variable `anOldSize` in the `Resize` method
2025-07-12 20:05:55 +01:00
Pasukhin Dmitry
08f6de3aff Data Exchange, Step Export - Preserving control directives (#601)
- Introduced `CleanTextForSend` static helper with detailed documentation.
- Updated `StepData_StepWriter::Send` to use the new helper and simplified quoting/line‐wrapping logic.
- Added comprehensive GTests for `CleanTextForSend` and updated the test suite configuration.
2025-07-12 17:05:39 +01:00
Pasukhin Dmitry
3d3a47a33a Testing - Update samples C++ version (#606)
- Updating Qt project files to use C++17 standard instead of GNU++11
- Configuring Visual Studio project files to use C++17 language standard
- Setting CMake projects to require C++17 standard
2025-07-12 15:44:22 +01:00
Pasukhin Dmitry
5643d5c34a Testing - Daily vcpkg package validation (#605)
- Introduce `.github/workflows/daily-ir-vcpkg-configure.yml` to run OCCT configuration daily on the IR branch for Windows, macOS, and Ubuntu.
- Create a `configure-occt` composite action to encapsulate vcpkg setup and CMake configuration per platform.
- Update the `build-occt` action to reuse the new `configure-occt` step instead of duplicating configuration logic.
2025-07-12 15:38:39 +01:00
Dmitrii Kulikov
675d75d134 Modeling, ShapeAnalysis_Curve - Mismatch between projected point and parameter (#600)
- Refactored `ProjectOnSegments`: renamed parameters, added early exit, and detailed doxygen-style docs.
- Updated `ProjectAct`: renamed local variables, stored initial projection values for fallback, and streamlined closed-curve handling.
- Removed `#ifdef OCCT_DEBUG` blocks in `ValidateRange`.
2025-07-12 11:47:49 +01:00
Pasukhin Dmitry
9707a155c0 Foundation Classes - Rework atomic and Standard_Condition (#598)
- Replace all `Standard_Atomic_Increment`/`Decrement` calls and `volatile` counters with `std::atomic` usage.
- Rewrite `Standard_Condition` header to use `std::mutex`, `std::condition_variable`, and `std::atomic<bool>`.
- Deprecate old atomic APIs in `Standard_Atomic.hxx`.
2025-07-10 10:10:33 +01:00
Pasukhin Dmitry
508700117c Testing - GH Remove extra jobs (#594)
Clear up duplicated jobs from PR actions.
2025-07-06 23:20:47 +01:00
Pasukhin Dmitry
29616ca8ff Testing - Draw testing clear up (#595)
- Deleted slow V3D and performance tests under `tests/v3d` and `tests/perf`.
- Updated `de_before_script` in DE/IGES tests to set `new_resource_path` to a subfolder per file.
- Added cleanup logic in `de_after_script` to delete the temporary resource directories.
2025-07-06 22:44:42 +01:00
Pasukhin Dmitry
d9684743dc Testing - Adding ASCII code validation (#593)
- Split the existing regression test artifact upload into separate Windows and macOS/Linux steps with platform-specific paths.
- Added `ascii-check` job in the build-and-test workflow to detect non-ASCII characters in changed files.
- Introduced a new composite action (`.github/actions/ascii-check`) to scan diffs and report any non-ASCII content.
2025-07-06 21:00:22 +01:00
Pasukhin Dmitry
c0a6aee75d Testing - Migration PR actions to VCPKG-based (#587)
Update the default testing to use result of VCPKG.
The 3rd-party are stored in GitHub NuGet storage and reused.
The 3rd-party archive with installed 3rd-party added as an artefact
Updated the actions to work with VCPKG 3rd party
2025-07-06 14:35:22 +01:00
Pasukhin Dmitry
bdbd5ac589 Documentation - Copilot instructions for OCCT development (#589)
Added copilot-instructions.md
Ignore other agents instruction for git history
2025-07-06 13:27:09 +01:00
Pasukhin Dmitry
22d437b771 Visualization - Enhance FFmpeg Compatibility Layer and Update Video Recorder (#582)
- Creation of Media_FFmpegCompatibility.pxx to wrap deprecated functions and API changes.
- Refactoring of Media_FormatContext and Media_CodecContext to use the new compatibility layer.
- Updates to Image_VideoRecorder and its tests to leverage the new compatibility functions and ensure proper codec context handling.
2025-06-27 14:38:01 +01:00
Pasukhin Dmitry
6b69f59803 Coding - Optimize gp_Vec, gp_Vec2d, gp_XY, and gp_XYZ classes (#578)
Renamed parameters and improved consistency across methods.
Simplified mathematical computations and replaced indirect API calls with direct data member access where performance‐critical.
Updated and optimized matrix operations including inversion, transposition, and power calculations.
2025-06-26 09:37:35 +01:00
Pasukhin Dmitry
ed7a447177 Coding - Add conversion utilities for STEP geometrical and visual enumerations (#545)
- Introduced RWStepGeom_RWTransitionCode for converting StepGeom_TransitionCode to/from string representations.
- Refactored RWStepGeom_RWTrimmedCurve to utilize RWStepGeom_RWTrimmingPreference for trimming preference conversions.
- Created RWStepGeom_RWTrimmingPreference for handling StepGeom_TrimmingPreference enumerations.
- Updated RWStepGeom_RWUniformCurve and related classes to use RWStepGeom_RWBSplineCurveForm for B-spline curve form conversions.
- Added RWStepGeom_RWUniformSurface and related classes to use RWStepGeom_RWBSplineSurfaceForm for B-spline surface form conversions.
- Implemented RWStepShape_RWBooleanOperator for boolean operator conversions in STEP shapes.
- Refactored RWStepShape_RWBooleanResult to utilize RWStepShape_RWBooleanOperator for boolean operator handling.
- Introduced RWStepVisual_RWCentralOrParallel for central or parallel projection type conversions.
- Added RWStepVisual_RWSurfaceSide for surface side enumeration conversions.
- Updated RWStepVisual_RWSurfaceStyleUsage to use RWStepVisual_RWSurfaceSide for handling surface side.
- Created RWStepVisual_RWTextPath for text path enumeration conversions.
- Refactored RWStepVisual_RWTextLiteral to utilize RWStepVisual_RWTextPath for text path handling.
- Updated RWStepVisual_RWViewVolume to use RWStepVisual_RWCentralOrParallel for projection type conversions.
2025-06-25 11:40:51 +01:00
Pasukhin Dmitry
dfb331296c Configuration - VCPKG add TclTk support (#580)
Introduces a new "tcltk" feature in vcpkg.json with relevant dependencies.
Updates tcl portfiles and patches to incorporate Tk building, installation, and cleanup.
Modifies CMake and batch environment templates to align with the new TclTk support.
2025-06-25 10:15:04 +01:00
Pasukhin Dmitry
fa5bf5dab2 Configuration - Remove jemalloc port files (#581)
Removed overrides for jemalloc, now use standard port
2025-06-25 10:14:14 +01:00
Pasukhin Dmitry
97920011fa Foundation Classes - Matrix multiplied issue (#522)
Refactor multiplication to avoid self-correlation issues by using a temporary copy.
Add a test file (math_Matrix_Test.cxx) to verify proper behavior.
2025-06-24 12:38:31 +01:00
Pasukhin Dmitry
57d6038b26 Shape Healing - Reusing Surface Analysis for Wire fixing (#565)
Providing prepared analysis from ShapeFix_Face to wire.
2025-06-23 18:22:47 +01:00
Pasukhin Dmitry
9726e465a9 Testing - Update workflows to use Windows 2025 for builds and tests (#579)
- Replace all `windows-2022` runners with `windows-2025`
- Add `ubuntu-24.04-arm` and `ubuntu-22.04-arm` to the OCCT build matrix
2025-06-20 21:22:15 +01:00
ikochetkova
f1cb756901 Data Exchange, Step Export - Ignoring unit factors during tessellation export (#577)
Provide unit factors into the tessellation export methods.
2025-06-20 15:38:33 +01:00
Pasukhin Dmitry
9ddcdae3f9 Coding, Data Exchange - Optimize entity graph evaluating #562
Updated the Evaluate() function to integrate memory pool usage and streamline the evaluation loop.
Simplified shared entity retrieval in GetShareds() and Sharings().
Added necessary include for NCollection_IncAllocator to support memory pooling.
2025-05-30 16:11:22 +01:00
Pasukhin Dmitry
4629ee0ca3 Coding - Refactor switch-case statements and improve memory management #569
- Added missing break statements in switch-case blocks in LDOMBasicString, LDOM_BasicElement, PCDM_ReadWriter, and IntCurve_IntConicConic_1 to prevent fall-through behavior.
- Enhanced Standard_Macro.hxx to support fallthrough attributes across different compilers.
- Corrected the use of std::forward in Standard_MemoryUtils.hxx for better type deduction.
- Replaced raw arrays with NCollection_Array1 in AdvApp2Var_SysBase for improved memory safety.
- Updated Extrema_ExtCC2d to utilize smart pointers for better memory management and avoid potential leaks.
- Refactored Units_UnitsDictionary to use NCollection_Array2 for matrix representation, improving readability and maintainability.
- Initialized TranFirst and TranLast in TopTrans_CurveTransition constructor for better default state management.
- Set myStatus in ShapeConstruct_ProjectCurveOnSurface constructor to ensure proper initialization.
- Changed matrix access in Units_UnitsDictionary to use NCollection_Array2 syntax for consistency.
2025-05-30 14:31:26 +01:00
Pasukhin Dmitry
3b62a5eb29 Configuration - Fixed issue with CSF variable overwriting #561
Include occt_csf file to define CSF variable before usage.
2025-05-24 12:27:14 +01:00
Elias Cohenca
4f2d4c1f4b Data Exchange, GLTF - fix saving edges when Merge Faces is enabled #554
Removed check for LineStrip mode to force use of Lines for merged faces
Updated primitive mode checks by removing LineStrip references
Added getShapeType to correctly determine the underlying shape type from compounds and updated index calculation logic
2025-05-23 12:24:13 +01:00
Dmitrii Kulikov
7ed396b0eb Modeling - Infinite loop when Simplifying Fuse operation, CPU to 100% #557
Minor refactoring of RelocatePCurvesToNewUorigin().
RelocatePCurvesToNewUorigin() can no longer stuck in infinite loop if it found the edge that is not present in theVEmap.
Test bug_gh544 is added to check the fix.
2025-05-22 11:29:54 +01:00
Dmitrii Kulikov
2398b87d36 Testing - GCC bug workaround for test NCollection_LocalArrayTest, CustomType #549
Test was failing on Ubuntu, gcc 13.3.0, debug, due to incorrect linkage.
Fixed by renaming TestStruct to NCollection_LocalArray_TestStruct.
2025-05-19 19:32:46 +01:00
Pasukhin Dmitry
973259d411 Coding - Small optimization of StepData_StepReaderData #543
Refactor SetEntityNumbers to use reusable memory pool.
Update SetRecord to avoid extra map searches.
2025-05-19 12:07:31 +01:00
Pasukhin Dmitry
e668a0d228 Testing - Add a new compilation on Clang without PCH #540
Updated a main workflow to validate the header and more precise warnings.
No PCH helps to validate missed headers.
Fixed PCH issue for mac os
Extend the parameters for occt build action.
2025-05-17 21:08:49 +01:00
Pasukhin Dmitry
c5256dcf70 Draw - Update DrawDefault script to handle missing directory cases #542
Fixed "Warning: could not find DRAW directory"
2025-05-17 13:00:50 +01:00
Elias Cohenca
b29788cae0 Data Exchange, GLTF - Change export line type to LINE_STRIP #535
GLTF exporter mark edges as a LINE, which is 2 connected points.
OCCT polylines is mostly line strip structure.
Updated GLTF reader to handle new type of lines
2025-05-17 10:00:40 +01:00
Dmitrii Kulikov
2eeb0ed5ba Modeling - Bnd_BoundSortBox::Compare fails in some cases #518
Class Bnd_BoundSortBox is refactored.
Some cases when Bnd_BoundSortBox could potentially fail to check
  intersection between boxes are fixed.
Google tests are added for Bnd_BoundSortBox class.
2025-05-16 16:04:48 +01:00
Pasukhin Dmitry
3e80fad177 Configuration - Update minimum version of C++ to 17 #537
Update C++ standard to C++17 in build configuration and documentation
2025-05-16 10:30:25 +01:00
Dmitrii Kulikov
7b016e5c28 Modeling - General Fuse (BOPAlgo_PaveFiller) optimization #514
Adding a null check for the triangulation in BRep_Tool::IsClosed.
Simplifying index lookup logic in BOPDS_DS.
Introducing helper functions (IsPlaneFF and IsClosedFF) and updating iteration loops in BOPAlgo_PaveFiller_6 for improved clarity and robustness.
2025-05-16 00:03:44 +01:00
Dmitrii Kulikov
a56d85bf15 Modeling - BRepFilletAPI_MakeFillet Segfault with two curves and rim #532
Added null checks for TopoDS_Face in ChFi3d_Builder_2 and BRepAdaptor_Surface.
Added tests to check for crash.
2025-05-15 19:35:52 +01:00
Pasukhin Dmitry
ebc3885799 Testing - IR integration enable concurrency #536
Fix concurrency cancel-in-progress condition in CI workflow for IR branch
2025-05-15 19:34:23 +01:00
Dmitrii Kulikov
66d2a06b5a Foundation Classes - Return value is overridden by OCCT #528
- Removed OSD_PerfMeter.h and integrated its functionality directly into OSD_PerfMeter.hxx.
- Updated OSD_PerfMeter to manage stopwatches through a singleton StopwatchStorage class.
- Enhanced meter initialization and management to support shared meters by name.
- Implemented methods for starting, stopping, and printing elapsed time for performance meters.
- Added OSD_PerfMeter_Test.cxx to implement unit tests for OSD_PerfMeter functionality.
- Test bug23237 is delete as it refers to removed code.
2025-05-15 15:21:52 +01:00
Pasukhin Dmitry
e82126db69 Testing - IR integration enable concurrency (#531)
Fix concurrency cancel-in-progress condition in CI workflow for IR branch
2025-05-15 15:20:27 +01:00
Pasukhin Dmitry
469da02ca6 Configuration - Fixed pathes to 3rd-party in cmake configuration (#523)
Update target_link_libraries to use PUBLIC and PRIVATE visibility for dependencies.
Now all 3rd-party is hidden for the external linking, no more issues to invalid path to 3rd-party
2025-05-15 13:04:14 +01:00
Pasukhin Dmitry
81ca522102 Testing - Target branch to compare validation of repo (#524)
Ensure latest workflow run ID is fetched from the correct repository in test summary action
2025-05-15 10:43:52 +01:00
ikochetkova
6aa605ef2f Data Exchange - Add missed headers (#530)
Add headers missed due to enabled BUILD_USE_PCH configure setting
2025-05-14 18:11:12 +01:00
ikochetkova
1158cba0df Modeling Algorithms - XCAFDoc_Editor::RescaleGeometry does not rescale translation of roots reference (#529)
Add processing of roots, which are transformed references of parts/assemblies.
2025-05-14 12:07:52 +01:00
ikochetkova
18a46604fc Data Exchange, Step Export - Apply a scaling transformation (#513)
Add possibility to export scaling factor into the STEP file as a cartesian_transformation_operator_3d.
Add flag for turning on/off (on by default) this behavior.
2025-05-12 17:15:58 +01:00
ikochetkova
7cd39973a4 Data Exchange, Gltf Reader - Implement non-uniform scaling in Gltf Import #503
Apply non-uniform scale factors directly to the triangulation during Gltf import.
Add flag for turning on/off (on by default) this behavior.
OCP-1948
2025-04-24 14:20:36 +01:00
ikochetkova
3ee97f70d0 Data Exchange, IGES Export - Missing Model Curves in transfer cache #483
Check if the curve was already created and use it. Works for shared edges cases.
2025-04-22 18:01:06 +01:00
Pasukhin Dmitry
7aa85582ad Coding - MSVC warning fix for STEP Rendering properties #498
Fixed warning on MSVC compiler with name overriding and type mismatching.
2025-04-13 21:05:22 +01:00
Pasukhin Dmitry
be4f373d1d Coding - Bump version to 8.0.0-rc1 #497 2025-04-13 16:31:52 +01:00
Pasukhin Dmitry
05039a1cf9 Configuration - TBB configuration prioritization to release #496
Refactor TBB CMake configuration for checking configuration type.
The solution will be reorganized to math release/debug version.
Prepared only for the hot-fix reason.
2025-04-13 14:37:36 +01:00
luzpaz
a3595cb871 Documentation - Fix various typos found in codebase #495
Found via codespell
2025-04-12 15:02:50 +01:00
sshutina
db33e7a43f Data Exchange, GLTF Reader - Add stream to json parser to read lines and points #489
Reorganize GLTF mesh reader to work with streams.
The updated scenario is impact on Edge and Vertex reading, which were
  rely on postponed loading operation, which re-create stream by file name.
2025-04-12 13:40:29 +01:00
Pasukhin Dmitry
15ec314a87 Modeling - Periodic BSpline curve bounding #493
Enhance periodic curve handling in BndLib_Add3dCurve::Add method.
Checks the periodic BSpline on 3 directions of period for tolerance upgrade.
2025-04-11 22:08:02 +01:00
Pasukhin Dmitry
7c8a432c8e Data Exchange, Step - Vis Material support #447
- Introduced STEPConstruct_RenderingProperties class to handle rendering properties in STEP format.
- Implemented constructors for initializing rendering properties from various sources including STEP entities, RGBA colors, and XCAF materials.
- Added methods to set and retrieve ambient, diffuse, and specular reflectance values, along with transparency and rendering method.
- Integrated functionality to create corresponding STEP and XCAF material entities.
2025-04-09 12:46:48 +01:00
Pasukhin Dmitry
74176f3b21 Data Exchange - Step Direction optimization #479
Refactor direction handling in STEP files for improved clarity and performance.
Moved to use array instead of vector
2025-04-06 16:48:09 +01:00
Pasukhin Dmitry
a897fd5942 Testing - Reorganize GitHub actions by actions #480
Refactor test workflow to be based on reusable actions.
2025-04-06 15:14:23 +01:00
Pasukhin Dmitry
5e5e7f1238 Testing - Units Tests for NCollection package #481
- Introduced tests for NCollection_Map, verifying constructors, addition, removal, and iteration functionalities.
- Added comprehensive tests for NCollection_Sequence, covering basic operations, iterator functionality, and complex type handling.
- Implemented tests for NCollection_SparseArray, including basic operations, iterator functionality, and data map interface.
- Created tests for NCollection_Vector, ensuring functionality for appending, resizing, and custom allocator usage.
2025-04-06 12:40:14 +01:00
Pasukhin Dmitry
638b0bfc40 Foundation Classes - HashUtils NoExcept optimization #473
Refactor hash functions in Standard_HashUtils for improved performanceю
Optimized load_bytes functionality.
Making all hash function noexcept
2025-04-04 16:38:56 +01:00
Dmitrii Kulikov
81efe3d3ed Data Exchange, Step Export - Decreasing file size #475
Functionality to remove duplicate entities from Step graph is added.
Class MergeSTEPEntities_Merger is main entry point.
Class MergeSTEPEntities_EntityProcessor implements the basic replacement
logic.
Children of MergeSTEPEntities_EntityProcessor implement the logic for
the replacement of particular step entity.
2025-04-03 17:23:10 +01:00
Pasukhin Dmitry
00ef3523af Testing - Inspector build error on latest CMake #477
Add CMAKE_POLICY_VERSION_MINIMUM to TInspector configuration for Windows and Linux
2025-04-03 13:25:40 +01:00
647 changed files with 19518 additions and 13311 deletions

95
.github/actions/ascii-check/action.yml vendored Normal file
View File

@@ -0,0 +1,95 @@
name: 'ASCII Code Check'
description: 'Check for non-ASCII characters in changed code files'
inputs:
base-ref:
description: 'Base reference to compare changes against'
required: true
default: 'master'
file-pattern:
description: 'Pattern to match files for ASCII check'
required: false
default: '^(src)/.*\.(cpp|hxx|cxx|lxx|h|pxx|hpp)$'
outputs:
has-non-ascii:
description: 'Whether any files contained non-ASCII characters'
value: ${{ steps.ascii-check.outputs.has_non_ascii }}
runs:
using: "composite"
steps:
- name: Get changed files
id: changed-files
shell: pwsh
run: |
$changedFiles = git diff --name-only origin/${{ inputs.base-ref }} HEAD |
Where-Object { $_ -match '${{ inputs.file-pattern }}' } |
Where-Object { Test-Path $_ }
$changedFiles | Set-Content "changed_files.txt"
if ($changedFiles.Count -gt 0) {
echo "has_files=true" >> $env:GITHUB_OUTPUT
}
- name: Check for non-ASCII characters
id: ascii-check
if: steps.changed-files.outputs.has_files == 'true'
shell: pwsh
run: |
$hasNonAscii = $false
$nonAsciiLogs = @()
$files = Get-Content "changed_files.txt" | Where-Object { Test-Path $_ }
foreach ($file in $files) {
Write-Output "Checking file: $file"
$fileContent = Get-Content -Path $file -Raw
$lineNumber = 1
$nonAsciiInFile = $false
foreach ($line in ($fileContent -split "`n")) {
# Find non-ASCII characters (char code > 127)
$nonAsciiMatches = [regex]::Matches($line, "[^\x00-\x7F]")
if ($nonAsciiMatches.Count -gt 0) {
$nonAsciiInFile = $true
$hasNonAscii = $true
foreach ($match in $nonAsciiMatches) {
$charCode = [int][char]$match.Value
$hexCode = "0x{0:X}" -f $charCode
$positionInLine = $match.Index + 1
$message = "Non-ASCII character found in '$file' at line $lineNumber, position $($positionInLine): '$($match.Value)' (Unicode: $hexCode)"
$nonAsciiLogs += $message
Write-Output $message
}
}
$lineNumber++
}
if ($nonAsciiInFile) {
Write-Output "::warning file=$file::File contains non-ASCII characters"
}
}
$nonAsciiLogs | Set-Content "non_ascii_report.txt"
if ($hasNonAscii) {
echo "has_non_ascii=true" >> $env:GITHUB_OUTPUT
}
- name: Upload non-ASCII report
if: steps.ascii-check.outputs.has_non_ascii == 'true'
uses: actions/upload-artifact@v4
with:
name: non-ascii-report
path: non_ascii_report.txt
- name: Failing step for non-ASCII issues
if: steps.ascii-check.outputs.has_non_ascii == 'true'
shell: pwsh
run: |
Write-Output "::error::Files contain non-ASCII characters. See the non-ascii-report artifact for details."
exit 1
branding:
icon: 'alert-circle'
color: 'red'

View File

@@ -10,38 +10,31 @@ runs:
choco install -y doxygen.install
shell: pwsh
- name: Download and extract 3rdparty dependencies
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
- name: Configure OCCT
run: |
mkdir build
cd build
cmake -T host=x64 `
-D USE_FREETYPE=ON `
-D USE_TK=OFF `
-D BUILD_USE_PCH=ON `
-D BUILD_OPT_PROFILE=Production `
-D BUILD_INCLUDE_SYMLINK=ON `
-D CMAKE_BUILD_TYPE=Release `
-D BUILD_DOC_Overview=ON `
-D BUILD_DOC_RefMan=ON `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D INSTALL_DIR=${{ github.workspace }}/install `
-D USE_D3D=ON `
-D USE_DRACO=ON `
-D USE_FFMPEG=ON `
-D USE_FREEIMAGE=ON `
-D USE_GLES2=ON `
-D USE_OPENVR=ON `
-D USE_VTK=ON `
-D USE_TBB=ON `
-D USE_RAPIDJSON=ON `
-D USE_OPENGL=ON `
-D BUILD_MODULE_Draw=OFF `
-D USE_D3D=OFF `
-D USE_DRACO=OFF `
-D USE_FFMPEG=OFF `
-D USE_FREEIMAGE=OFF `
-D USE_GLES2=OFF `
-D USE_OPENVR=OFF `
-D USE_VTK=OFF `
-D USE_TBB=OFF `
-D USE_RAPIDJSON=OFF `
-D USE_OPENGL=OFF `
-D USE_FREETYPE=OFF `
-D USE_TK=OFF `
-D USE_TCL=OFF `
-D CMAKE_CXX_FLAGS="/W4 /WX" `
-D CMAKE_C_FLAGS="/W4 /WX" ..
shell: pwsh

85
.github/actions/build-occt/action.yml vendored Normal file
View File

@@ -0,0 +1,85 @@
name: 'Build OCCT'
description: 'Prepare and build OCCT on a specific platform'
inputs:
platform:
description: 'Platform (windows, macos, linux)'
required: true
compiler:
description: 'Compiler (msvc, clang, gcc)'
required: true
artifact-name:
description: 'Name of the artifact to store build results'
required: true
additional-cmake-flags:
description: 'Additional CMake flags'
required: false
default: ''
use-vtk:
description: 'Enable VTK'
required: false
default: 'true'
build-use-pch:
description: 'Enable precompiled headers'
required: false
default: 'true'
build-opt-profile:
description: 'Build optimization profile'
required: false
default: 'Production'
cmake-build-type:
description: 'CMake build type (Release, Debug, etc)'
required: false
default: 'Release'
github-token:
description: 'GitHub token for vcpkg NuGet package access'
required: true
runs:
using: "composite"
steps:
- name: Configure OCCT
uses: ./.github/actions/configure-occt
with:
platform: ${{ inputs.platform }}
compiler: ${{ inputs.compiler }}
additional-cmake-flags: ${{ inputs.additional-cmake-flags }}
use-vtk: ${{ inputs.use-vtk }}
build-use-pch: ${{ inputs.build-use-pch }}
build-opt-profile: ${{ inputs.build-opt-profile }}
cmake-build-type: ${{ inputs.cmake-build-type }}
github-token: ${{ inputs.github-token }}
- name: Upload vcpkg cache
uses: ./.github/actions/upload-vcpkg-cache
with:
artifact-name: ${{ inputs.artifact-name }}-cache
build-directory: build
- name: Build OCCT (Windows)
if: ${{ inputs.platform == 'windows' }}
run: |
cd build
cmake --build . --target install --config Release
shell: pwsh
- name: Build OCCT (macOS)
if: ${{ inputs.platform == 'macos' }}
run: |
cd build
make install -j$(sysctl -n hw.logicalcpu)
shell: bash
- name: Build OCCT (Linux)
if: ${{ inputs.platform == 'linux' }}
run: |
cd build
cmake --build . --target install --config Release -- -j
shell: bash
- name: Upload install directory
uses: actions/upload-artifact@v4.4.3
with:
name: ${{ inputs.artifact-name }}
path: install
retention-days: 7

View File

@@ -22,6 +22,11 @@ runs:
name: ${{ inputs.install-artifact-name }}
path: occt-install
- name: Download vcpkg cache
uses: ./.github/actions/download-vcpkg-cache
with:
artifact-name: ${{ inputs.install-artifact-name }}-cache
- name: Install Windows dependencies
if: inputs.platform == 'windows'
shell: pwsh
@@ -84,6 +89,12 @@ runs:
run: |
cd ${{ github.workspace }}/occt-install/bin
source env.sh
# Set library paths for vcpkg dependencies
export LD_LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib:${{ github.workspace }}/occt-install/lib:$LD_LIBRARY_PATH"
export LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib:${{ github.workspace }}/occt-install/lib:$LIBRARY_PATH"
export PKG_CONFIG_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib/pkgconfig:$PKG_CONFIG_PATH"
cd ${{ github.workspace }}/samples/qt
for sample in IESample Tutorial FuncDemo; do
@@ -92,7 +103,13 @@ runs:
host=`uname -s`
export STATION=$host
export RES_DIR="${{ github.workspace }}/samples/qt/${sample}/result"
qmake $sample.pro
# Configure qmake with vcpkg paths
qmake $sample.pro \
"LIBS += -L${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib" \
"LIBS += -Wl,-rpath,${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib" \
"INCLUDEPATH += ${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/include"
aNbJobs="$(getconf _NPROCESSORS_ONLN)"
make -j$aNbJobs release
cd ..

View File

@@ -22,6 +22,11 @@ runs:
name: ${{ inputs.install-artifact-name }}
path: occt-install
- name: Download vcpkg cache
uses: ./.github/actions/download-vcpkg-cache
with:
artifact-name: ${{ inputs.install-artifact-name }}-cache
- name: Install Windows dependencies
if: inputs.platform == 'windows'
shell: pwsh
@@ -40,7 +45,7 @@ runs:
run: |
git clone https://github.com/Open-Cascade-SAS/Inspector.git inspector
cd inspector
git checkout 6da9ba776ef72a17dca3331974df4200024c7f34
git checkout 0757c9bbe4d856a9cd26a62a453fc31879d9d054
- name: Configure TInspector - Windows
if: inputs.platform == 'windows'
@@ -55,6 +60,7 @@ runs:
-D 3RDPARTY_DIR=${{ github.workspace }}//3rdparty-vc14-64 `
-D OpenCASCADE_DIR=${{ github.workspace }}/occt-install `
-D INSTALL_DIR=${{ github.workspace }}/inspector/install `
-D CMAKE_POLICY_VERSION_MINIMUM=3.5 `
..
- name: Configure TInspector - Linux
@@ -64,11 +70,17 @@ runs:
cd inspector
mkdir build
cd build
export LD_LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib:${{ github.workspace }}/occt-install/lib:$LD_LIBRARY_PATH"
cmake -G "Unix Makefiles" \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_SHARED_LIBS=ON \
-D OpenCASCADE_DIR=${{ github.workspace }}/occt-install \
-D INSTALL_DIR=${{ github.workspace }}/inspector/install \
-D CMAKE_POLICY_VERSION_MINIMUM=3.5 \
-D CMAKE_LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib" \
-D CMAKE_INCLUDE_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/include" \
-D CMAKE_EXE_LINKER_FLAGS="-L${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib -Wl,-rpath,${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib" \
-D CMAKE_SHARED_LINKER_FLAGS="-L${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib -Wl,-rpath,${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib" \
..
- name: Build TInspector - Windows
@@ -83,6 +95,10 @@ runs:
shell: bash
run: |
cd inspector/build
# Set library paths for build and runtime
export LD_LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib:${{ github.workspace }}/occt-install/lib:$LD_LIBRARY_PATH"
export LIBRARY_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib:${{ github.workspace }}/occt-install/lib:$LIBRARY_PATH"
export PKG_CONFIG_PATH="${{ github.workspace }}/build/vcpkg_installed/x64-linux-dynamic/lib/pkgconfig:$PKG_CONFIG_PATH"
make install -j$(nproc)
- name: Upload TInspector installation

View File

@@ -0,0 +1,83 @@
name: 'CMake Basic Build'
description: 'Configure and build OCCT with basic configuration'
inputs:
generator:
description: 'CMake generator'
required: true
default: 'Ninja'
cc:
description: 'C compiler'
required: true
cxx:
description: 'C++ compiler'
required: true
build-type:
description: 'Build type (Debug, Release)'
required: false
default: 'Release'
compiler-flags:
description: 'Additional compiler flags'
required: false
default: ''
thirdparty-dir:
description: '3rd party directory'
required: false
default: ''
shell-type:
description: 'Shell type to use (powershell, msys2, bash)'
required: false
default: 'auto'
runs:
using: "composite"
steps:
- name: Configure basic build (Unix/MSYS2)
if: runner.os != 'Windows' || inputs.shell-type == 'msys2'
run: |
mkdir -p build
cd build
cmake -G "${{ inputs.generator }}" \
-D CMAKE_C_COMPILER=${{ inputs.cc }} \
-D CMAKE_CXX_COMPILER=${{ inputs.cxx }} \
${{ inputs.thirdparty-dir != '' && format('-D 3RDPARTY_DIR={0}', inputs.thirdparty-dir) || '' }} \
-D CMAKE_BUILD_TYPE=${{ inputs.build-type }} \
${{ inputs.compiler-flags }} ..
shell: ${{ inputs.shell-type == 'msys2' && 'msys2 {0}' || 'bash' }}
- name: Configure basic build (Windows PowerShell)
if: runner.os == 'Windows' && inputs.shell-type != 'msys2'
run: |
mkdir build
cd build
cmake -G "${{ inputs.generator }}" `
-D CMAKE_C_COMPILER=${{ inputs.cc }} `
-D CMAKE_CXX_COMPILER=${{ inputs.cxx }} `
${{ inputs.thirdparty-dir != '' && format('-D 3RDPARTY_DIR={0}', inputs.thirdparty-dir) || '' }} `
-D CMAKE_BUILD_TYPE=${{ inputs.build-type }} `
${{ inputs.compiler-flags }} ..
shell: pwsh
- name: Build basic (Unix/MSYS2)
if: runner.os != 'Windows' || inputs.shell-type == 'msys2'
run: |
cd build
cmake --build . --config ${{ inputs.build-type }} -- -j 4
shell: ${{ inputs.shell-type == 'msys2' && 'msys2 {0}' || 'bash' }}
- name: Build basic (Windows PowerShell)
if: runner.os == 'Windows' && inputs.shell-type != 'msys2'
run: |
cd build
cmake --build . --config ${{ inputs.build-type }}
shell: pwsh
- name: Clean up build (Unix/MSYS2)
if: runner.os != 'Windows' || inputs.shell-type == 'msys2'
run: rm -rf build
shell: ${{ inputs.shell-type == 'msys2' && 'msys2 {0}' || 'bash' }}
- name: Clean up build (Windows PowerShell)
if: runner.os == 'Windows' && inputs.shell-type != 'msys2'
run: Remove-Item -Recurse -Force build
shell: pwsh

View File

@@ -0,0 +1,149 @@
name: 'CMake Full Build'
description: 'Configure and build OCCT with full configuration (shared/static)'
inputs:
generator:
description: 'CMake generator'
required: true
default: 'Ninja'
cc:
description: 'C compiler'
required: true
cxx:
description: 'C++ compiler'
required: true
build-type:
description: 'Build type (Debug, Release)'
required: false
default: 'Release'
library-type:
description: 'Library type (Shared, Static)'
required: false
default: 'Shared'
opt-profile:
description: 'Optimization profile (Production, Default)'
required: false
default: 'Production'
compiler-flags:
description: 'Additional compiler flags'
required: false
default: ''
thirdparty-dir:
description: '3rd party directory'
required: false
default: ''
rapidjson-dir:
description: 'RapidJSON directory'
required: false
default: ''
use-vtk:
description: 'Enable VTK'
required: false
default: 'ON'
use-tbb:
description: 'Enable TBB'
required: false
default: 'ON'
with-debug:
description: 'Enable BUILD_WITH_DEBUG'
required: false
default: 'OFF'
shell-type:
description: 'Shell type to use (powershell, msys2, bash)'
required: false
default: 'auto'
runs:
using: "composite"
steps:
- name: Configure full build (Unix/MSYS2)
if: runner.os != 'Windows' || inputs.shell-type == 'msys2'
run: |
mkdir -p build
cd build
cmake -G "${{ inputs.generator }}" \
-D CMAKE_C_COMPILER=${{ inputs.cc }} \
-D CMAKE_CXX_COMPILER=${{ inputs.cxx }} \
${{ inputs.thirdparty-dir != '' && format('-D 3RDPARTY_DIR={0}', inputs.thirdparty-dir) || '' }} \
${{ inputs.rapidjson-dir != '' && format('-D 3RDPARTY_RAPIDJSON_DIR={0}', inputs.rapidjson-dir) || '' }} \
-D BUILD_USE_PCH=OFF \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=${{ inputs.opt-profile }} \
-D BUILD_LIBRARY_TYPE=${{ inputs.library-type }} \
${{ inputs.with-debug == 'ON' && '-D BUILD_WITH_DEBUG=ON' || '' }} \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=${{ inputs.build-type }} \
-D USE_MMGR_TYPE=JEMALLOC \
-D INSTALL_DIR=${{ github.workspace }}/install-${{ inputs.build-type }} \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=${{ inputs.use-vtk }} \
-D USE_TBB=${{ inputs.use-tbb }} \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
${{ inputs.compiler-flags }} ..
shell: ${{ inputs.shell-type == 'msys2' && 'msys2 {0}' || 'bash' }}
- name: Configure full build (Windows PowerShell)
if: runner.os == 'Windows' && inputs.shell-type != 'msys2'
run: |
mkdir build
cd build
cmake -G "${{ inputs.generator }}" `
-D CMAKE_C_COMPILER=${{ inputs.cc }} `
-D CMAKE_CXX_COMPILER=${{ inputs.cxx }} `
${{ inputs.thirdparty-dir != '' && format('-D 3RDPARTY_DIR={0}', inputs.thirdparty-dir) || '' }} `
${{ inputs.rapidjson-dir != '' && format('-D 3RDPARTY_RAPIDJSON_DIR={0}', inputs.rapidjson-dir) || '' }} `
-D BUILD_USE_PCH=OFF `
-D BUILD_INCLUDE_SYMLINK=ON `
-D BUILD_OPT_PROFILE=${{ inputs.opt-profile }} `
-D BUILD_LIBRARY_TYPE=${{ inputs.library-type }} `
${{ inputs.with-debug == 'ON' && '-D BUILD_WITH_DEBUG=ON' || '' }} `
-D USE_TK=ON `
-D CMAKE_BUILD_TYPE=${{ inputs.build-type }} `
-D USE_MMGR_TYPE=JEMALLOC `
-D INSTALL_DIR=${{ github.workspace }}/install-${{ inputs.build-type }} `
-D USE_FREETYPE=ON `
-D USE_DRACO=ON `
-D USE_FFMPEG=OFF `
-D USE_FREEIMAGE=ON `
-D USE_GLES2=ON `
-D USE_OPENVR=ON `
-D USE_VTK=${{ inputs.use-vtk }} `
-D USE_TBB=${{ inputs.use-tbb }} `
-D USE_RAPIDJSON=ON `
-D USE_OPENGL=ON `
${{ inputs.compiler-flags }} ..
shell: pwsh
- name: Build full (Unix/MSYS2)
if: runner.os != 'Windows' || inputs.shell-type == 'msys2'
run: |
cd build
cmake --build . --target install --config ${{ inputs.build-type }} -- -j 4
shell: ${{ inputs.shell-type == 'msys2' && 'msys2 {0}' || 'bash' }}
- name: Build full (Windows PowerShell)
if: runner.os == 'Windows' && inputs.shell-type != 'msys2'
run: |
cd build
cmake --build . --target install --config ${{ inputs.build-type }}
shell: pwsh
- name: Clean up build (Unix/MSYS2)
if: runner.os != 'Windows' || inputs.shell-type == 'msys2'
run: |
rm -rf build
rm -rf ${{ github.workspace }}/install-${{ inputs.build-type }}
shell: ${{ inputs.shell-type == 'msys2' && 'msys2 {0}' || 'bash' }}
- name: Clean up build (Windows PowerShell)
if: runner.os == 'Windows' && inputs.shell-type != 'msys2'
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install-${{ inputs.build-type }}
shell: pwsh

View File

@@ -0,0 +1,169 @@
name: 'Configure OCCT'
description: 'Setup vcpkg and configure OCCT on a specific platform without building'
inputs:
platform:
description: 'Platform (windows, macos, linux)'
required: true
compiler:
description: 'Compiler (msvc, clang, gcc)'
required: true
additional-cmake-flags:
description: 'Additional CMake flags'
required: false
default: ''
use-vtk:
description: 'Enable VTK'
required: false
default: 'true'
build-use-pch:
description: 'Enable precompiled headers'
required: false
default: 'true'
build-opt-profile:
description: 'Build optimization profile'
required: false
default: 'Production'
cmake-build-type:
description: 'CMake build type (Release, Debug, etc)'
required: false
default: 'Release'
github-token:
description: 'GitHub token for vcpkg NuGet package access'
required: true
runs:
using: "composite"
steps:
- name: Setup vcpkg
uses: ./.github/actions/vcpkg-setup
with:
github-token: ${{ inputs.github-token }}
- name: Download and extract Mesa3D (Windows)
if: ${{ inputs.platform == 'windows' }}
run: |
curl -L -o mesa3d.7z https://github.com/pal1000/mesa-dist-win/releases/download/24.3.2/mesa3d-24.3.2-release-mingw.7z
7z x mesa3d.7z -omesa3d
shell: pwsh
- name: Run system-wide deployment (Windows)
if: ${{ inputs.platform == 'windows' }}
run: |
cd mesa3d
.\systemwidedeploy.cmd 1
.\systemwidedeploy.cmd 5
shell: cmd
- name: Install dependencies (Linux)
if: ${{ inputs.platform == 'linux' }}
run: sudo apt-get update && sudo apt-get install -y cmake ${{ inputs.compiler == 'clang' && 'clang' || 'gcc g++' }} make libglu1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev
shell: bash
- name: Install required packages (macOS)
if: ${{ inputs.platform == 'macos' }}
run: |
brew update || true
# temporary workaround for missing tcl-tk
brew install tcl-tk || true
# Force link any conflicting packages
brew link --overwrite python@3.12 || true
brew link --overwrite python@3.13 || true
shell: bash
- name: Configure OCCT (Windows)
if: ${{ inputs.platform == 'windows' }}
run: |
mkdir build
cd build
cmake -T ${{ inputs.compiler == 'msvc' && 'host=x64' || 'ClangCL' }} `
-D USE_FREETYPE=ON `
-D USE_TK=ON `
-D BUILD_USE_PCH=${{ inputs.build-use-pch }} `
-D BUILD_OPT_PROFILE=${{ inputs.build-opt-profile }} `
-D BUILD_INCLUDE_SYMLINK=ON `
-D CMAKE_BUILD_TYPE=${{ inputs.cmake-build-type }} `
-D INSTALL_DIR=${{ github.workspace }}/install `
-D BUILD_USE_VCPKG=ON `
-D VCPKG_TARGET_TRIPLET=x64-windows `
-D USE_D3D=ON `
-D USE_DRACO=ON `
-D USE_FFMPEG=ON `
-D USE_FREEIMAGE=ON `
-D USE_GLES2=ON `
-D USE_OPENVR=ON `
-D USE_VTK=${{ inputs.use-vtk }} `
-D USE_TBB=ON `
-D USE_RAPIDJSON=ON `
-D USE_OPENGL=ON `
-D BUILD_GTEST=ON `
-D BUILD_CPP_STANDARD=C++17 `
-D INSTALL_GTEST=ON `
${{ inputs.additional-cmake-flags }} ..
echo "Configuration completed successfully for Windows"
shell: pwsh
- name: Configure OCCT (macOS)
if: ${{ inputs.platform == 'macos' }}
run: |
mkdir -p build
cd build
cmake -G "Unix Makefiles" \
-D CMAKE_C_COMPILER=${{ inputs.compiler == 'clang' && 'clang' || 'gcc' }} \
-D CMAKE_CXX_COMPILER=${{ inputs.compiler == 'clang' && 'clang++' || 'g++' }} \
-D BUILD_USE_PCH=${{ inputs.build-use-pch }} \
-D BUILD_OPT_PROFILE=${{ inputs.build-opt-profile }} \
-D BUILD_INCLUDE_SYMLINK=ON \
-D CMAKE_BUILD_TYPE=${{ inputs.cmake-build-type }} \
-D INSTALL_DIR=${{ github.workspace }}/install \
-D BUILD_USE_VCPKG=ON \
-D VCPKG_TARGET_TRIPLET=arm64-osx-dynamic \
-D USE_RAPIDJSON=ON \
-D USE_DRACO=ON \
-D USE_FREETYPE=ON \
-D USE_OPENGL=ON \
-D USE_FREEIMAGE=ON \
-D BUILD_GTEST=ON \
-D BUILD_CPP_STANDARD=C++17 \
-D INSTALL_GTEST=ON \
-D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
${{ inputs.additional-cmake-flags }} ..
echo "Configuration completed successfully for macOS"
shell: bash
- name: Configure OCCT (Linux)
if: ${{ inputs.platform == 'linux' }}
run: |
mkdir -p build
cd build
# Set environment to help vcpkg find system libraries
export PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH"
export CMAKE_PREFIX_PATH="/usr:/usr/local:$CMAKE_PREFIX_PATH"
cmake -G "Unix Makefiles" \
-D CMAKE_C_COMPILER=${{ inputs.compiler == 'clang' && 'clang' || 'gcc' }} \
-D CMAKE_CXX_COMPILER=${{ inputs.compiler == 'clang' && 'clang++' || 'g++' }} \
-D BUILD_USE_PCH=${{ inputs.build-use-pch }} \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=${{ inputs.build-opt-profile }} \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=${{ inputs.cmake-build-type }} \
-D INSTALL_DIR=${{ github.workspace }}/install \
-D BUILD_USE_VCPKG=ON \
-D BUILD_LIBRARY_TYPE=Shared \
-D VCPKG_TARGET_TRIPLET=x64-linux-dynamic \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=ON \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=${{ inputs.use-vtk }} \
-D USE_TBB=ON \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
-D BUILD_GTEST=ON \
-D BUILD_CPP_STANDARD=C++17 \
-D INSTALL_GTEST=ON \
${{ inputs.additional-cmake-flags }} ..
echo "Configuration completed successfully for Linux"
shell: bash

View File

@@ -0,0 +1,79 @@
name: 'Download vcpkg Cache'
description: 'Download and restore vcpkg installed packages and cache'
inputs:
artifact-name:
description: 'Name of the artifact containing vcpkg cache'
required: true
build-directory:
description: 'Build directory where vcpkg_installed should be restored'
required: false
default: 'build'
runs:
using: "composite"
steps:
- name: Download vcpkg tar archive
uses: actions/download-artifact@v4.1.8
with:
name: ${{ inputs.artifact-name }}
path: ${{ inputs.build-directory }}
- name: Extract vcpkg dependencies
run: |
cd ${{ inputs.build-directory }}
tar -xzf vcpkg-dependencies.tar.gz
rm vcpkg-dependencies.tar.gz
shell: bash
- name: Copy manual-link libraries and set paths for Windows
if: runner.os == 'Windows'
run: |
$vcpkg_bin = "${{ inputs.build-directory }}/vcpkg_installed/x64-windows/bin"
$vcpkg_lib = "${{ inputs.build-directory }}/vcpkg_installed/x64-windows/lib"
$vcpkg_manual = "${{ inputs.build-directory }}/vcpkg_installed/x64-windows/lib/manual-link"
# Copy manual-link DLLs to bin directory for runtime access
if (Test-Path $vcpkg_manual) {
Write-Host "Copying manual-link libraries to bin directory"
Copy-Item "$vcpkg_manual\*" "$vcpkg_bin\" -Force -ErrorAction SilentlyContinue
}
# Set library search paths
$current_path = $env:PATH
echo "PATH=$vcpkg_bin;$vcpkg_lib;$vcpkg_manual;$current_path" >> $env:GITHUB_ENV
shell: pwsh
- name: Copy manual-link libraries and set paths for Linux
if: runner.os == 'Linux'
run: |
vcpkg_lib="${{ inputs.build-directory }}/vcpkg_installed/x64-linux-dynamic/lib"
vcpkg_manual="${{ inputs.build-directory }}/vcpkg_installed/x64-linux-dynamic/lib/manual-link"
# Copy manual-link libraries to main lib directory for runtime access
if [ -d "$vcpkg_manual" ]; then
echo "Copying manual-link libraries to main lib directory"
cp -f "$vcpkg_manual"/* "$vcpkg_lib/" 2>/dev/null || true
fi
# Set library search paths
echo "LD_LIBRARY_PATH=$vcpkg_lib:$vcpkg_manual:$LD_LIBRARY_PATH" >> $GITHUB_ENV
shell: bash
- name: Copy manual-link libraries and set paths for macOS
if: runner.os == 'macOS'
run: |
vcpkg_lib="${{ inputs.build-directory }}/vcpkg_installed/arm64-osx-dynamic/lib"
vcpkg_manual="${{ inputs.build-directory }}/vcpkg_installed/arm64-osx-dynamic/lib/manual-link"
# Copy manual-link libraries to main lib directory for runtime access
if [ -d "$vcpkg_manual" ]; then
echo "Copying manual-link libraries to main lib directory"
cp -f "$vcpkg_manual"/* "$vcpkg_lib/" 2>/dev/null || true
fi
# Set library search paths
echo "DYLD_FALLBACK_LIBRARY_PATH=$vcpkg_lib:$vcpkg_manual:$DYLD_FALLBACK_LIBRARY_PATH" >> $GITHUB_ENV
echo "DYLD_LIBRARY_PATH=$vcpkg_lib:$vcpkg_manual:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV
shell: bash

View File

@@ -0,0 +1,319 @@
name: 'Retest Failures'
description: 'Rerun failed tests and update test results'
inputs:
platform:
description: 'Platform (windows, macos, linux)'
required: true
compiler:
description: 'Compiler (msvc, clang, gcc)'
required: true
install-artifact-name:
description: 'Name of the artifact containing the install directory'
required: true
results-artifact-name:
description: 'Name of the artifact containing the test results'
required: true
test-directory-name:
description: 'Name of the directory containing test results'
required: true
runs:
using: "composite"
steps:
- name: Download previous test results (Windows)
if: ${{ inputs.platform == 'windows' }}
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.results-artifact-name }}
path: install/results
- name: Download previous test results (macOS/Linux)
if: ${{ inputs.platform != 'windows' }}
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.results-artifact-name }}
path: install/bin/results
- name: Check for test failures (Windows)
id: check_failures_windows
if: ${{ inputs.platform == 'windows' }}
shell: pwsh
run: |
$failedCount = 0
if (Test-Path "install/results/${{ inputs.test-directory-name }}/tests.log") {
$content = Get-Content "install/results/${{ inputs.test-directory-name }}/tests.log"
$totalLine = $content | Select-String "Total cases:"
if ($totalLine) {
if ($totalLine -match "FAILED") {
$failedCount = ($totalLine | ForEach-Object { $_.Line -replace '.*?(\d+) FAILED.*','$1' }) -as [int]
}
}
echo "failed_count=$failedCount" >> $env:GITHUB_OUTPUT
if ($failedCount -gt 0) {
echo "Tests failed count: $failedCount"
}
}
- name: Check for test failures (macOS/Linux)
id: check_failures_unix
if: ${{ inputs.platform != 'windows' }}
shell: bash
run: |
failed_count=0
if [ -f "install/bin/results/${{ inputs.test-directory-name }}/tests.log" ]; then
total_line=$(grep "Total cases:" install/bin/results/${{ inputs.test-directory-name }}/tests.log)
if [ ! -z "$total_line" ]; then
if [[ $total_line =~ "FAILED" ]]; then
failed_count=$(echo "$total_line" | grep -o "[0-9]* FAILED" | awk '{print $1}')
fi
fi
echo "failed_count=$failed_count" >> $GITHUB_OUTPUT
if [ "$failed_count" -gt 0 ]; then
echo "Tests failed count: $failed_count"
fi
fi
- name: Set failed count
id: check_failures
shell: ${{ inputs.platform == 'windows' && 'pwsh' || 'bash' }}
run: |
${{ inputs.platform == 'windows' && format('
echo "failed_count={0}" >> $env:GITHUB_OUTPUT
', steps.check_failures_windows.outputs.failed_count) || format('
echo "failed_count={0}" >> $GITHUB_OUTPUT
', steps.check_failures_unix.outputs.failed_count) }}
- name: Download vcpkg cache
if: steps.check_failures.outputs.failed_count > 0
uses: ./.github/actions/download-vcpkg-cache
with:
artifact-name: ${{ inputs.install-artifact-name }}-cache
- name: Install dependencies (Linux)
if: ${{ inputs.platform == 'linux' && steps.check_failures.outputs.failed_count > 0 }}
shell: bash
run: sudo apt-get update && sudo apt-get install -y cmake ${{ inputs.compiler == 'clang' && 'clang' || 'gcc g++' }} make libglu1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev fonts-noto-cjk fonts-liberation fonts-ubuntu fonts-liberation fonts-ubuntu fonts-noto-cjk fonts-ipafont-gothic fonts-ipafont-mincho fonts-unfonts-core
- name: Setup Xvfb and Mesa (Linux)
if: ${{ inputs.platform == 'linux' && steps.check_failures.outputs.failed_count > 0 }}
uses: ./.github/actions/setup-xvfb-mesa
- name: Download test data (Windows)
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
shell: pwsh
run: |
cd data
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.zip -OutFile opencascade-dataset-7.9.0.zip
Expand-Archive -Path opencascade-dataset-7.9.0.zip -DestinationPath .
Remove-Item opencascade-dataset-7.9.0.zip
- name: Download test data (macOS/Linux)
if: ${{ (inputs.platform == 'macos' || inputs.platform == 'linux') && steps.check_failures.outputs.failed_count > 0 }}
shell: bash
run: |
cd data
curl -L -O https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.${{ inputs.platform == 'macos' && 'tar.xz' || 'tar.xz' }}
tar -xf opencascade-dataset-7.9.0.tar.xz
- name: Download and extract install directory
if: steps.check_failures.outputs.failed_count > 0
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.install-artifact-name }}
path: install
- name: Download and extract Mesa3D (Windows)
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
shell: pwsh
run: |
curl -L -o mesa3d.7z https://github.com/pal1000/mesa-dist-win/releases/download/24.3.2/mesa3d-24.3.2-release-mingw.7z
7z x mesa3d.7z -omesa3d
- name: Run system-wide deployment (Windows)
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
shell: cmd
run: |
cd mesa3d
.\systemwidedeploy.cmd 1
.\systemwidedeploy.cmd 5
- name: Install CJK Fonts (Windows)
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
shell: pwsh
run: |
Invoke-WebRequest -Uri https://noto-website-2.storage.googleapis.com/pkgs/Noto-hinted.zip -OutFile Noto-hinted.zip
Expand-Archive -Path Noto-hinted.zip -DestinationPath $env:windir\Fonts
Remove-Item Noto-hinted.zip
- name: Set execute permissions on DRAWEXE (macOS/Linux)
if: ${{ (inputs.platform == 'macos' || inputs.platform == 'linux') && steps.check_failures.outputs.failed_count > 0 }}
shell: bash
run: chmod +x install/${{ inputs.platform == 'macos' && 'bin' || 'bin' }}/DRAWEXE
- name: Run regression tests (Windows)
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
shell: cmd
run: |
cd install
call env.bat vc14 win64 release
DRAWEXE.exe -v -c testgrid -regress results/${{ inputs.test-directory-name }} -outdir results/${{ inputs.test-directory-name }}-retest -parallel 0
env:
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Run regression tests (macOS/Linux)
if: ${{ (inputs.platform == 'macos' || inputs.platform == 'linux') && steps.check_failures.outputs.failed_count > 0 }}
shell: bash
run: |
cd install
cd bin
source env.sh
./DRAWEXE -v -c testgrid -regress results/${{ inputs.test-directory-name }} -outdir results/${{ inputs.test-directory-name }}-retest -parallel 0
env:
DISPLAY: ${{ inputs.platform == 'linux' && ':99' || '' }}
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Repeating failed tests (Windows)
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 && steps.check_failures.outputs.failed_count < 20 }}
shell: cmd
run: |
cd install
call env.bat vc14 win64 release
# Repeat failed tests for 10 times
for /l %%i in (1,1,10) do (
DRAWEXE.exe -v -c testgrid -regress results/${{ inputs.test-directory-name }}-retest -outdir results/${{ inputs.test-directory-name }}-retest -parallel 0 -overwrite
DRAWEXE.exe -v -c "testsummarize results/${{ inputs.test-directory-name }}-retest"
)
env:
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Repeating failed tests (macOS/Linux)
if: ${{ inputs.platform != 'windows' && steps.check_failures.outputs.failed_count > 0 && steps.check_failures.outputs.failed_count < 20 }}
shell: bash
run: |
cd install
cd bin
source env.sh
# Repeat failed tests for 10 times
for i in {1..10}; do
./DRAWEXE -v -c testgrid -regress results/${{ inputs.test-directory-name }}-retest -outdir results/${{ inputs.test-directory-name }}-retest -parallel 0 -overwrite
./DRAWEXE -v -c "testsummarize results/${{ inputs.test-directory-name }}-retest"
done
env:
DISPLAY: ${{ inputs.platform == 'linux' && ':99' || '' }}
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Upload regression test results (Windows)
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
uses: actions/upload-artifact@v4.4.3
with:
name: ${{ inputs.results-artifact-name }}-retest
path: install/results/${{ inputs.test-directory-name }}-retest
retention-days: 15
overwrite: true
- name: Upload regression test results (macOS/Linux)
if: ${{ inputs.platform != 'windows' && steps.check_failures.outputs.failed_count > 0 }}
uses: actions/upload-artifact@v4.4.3
with:
name: ${{ inputs.results-artifact-name }}-retest
path: install/bin/results/${{ inputs.test-directory-name }}-retest
retention-days: 15
overwrite: true
- name: Copy retest results back to original location (Windows)
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
shell: cmd
run: |
cd install\results\${{ inputs.test-directory-name }}-retest
if exist "*" (
xcopy /s /y /i . "..\${{ inputs.test-directory-name }}"
cd ..\..
call env.bat vc14 win64 release
DRAWEXE.exe -v -c "testsummarize results/${{ inputs.test-directory-name }}"
) else (
echo No retest results to copy - directory is empty
)
- name: Copy retest results back to original location (macOS/Linux)
if: ${{ inputs.platform != 'windows' && steps.check_failures.outputs.failed_count > 0 }}
shell: bash
run: |
cd install/bin/results/${{ inputs.test-directory-name }}-retest
if [ "$(ls -A)" ]; then
cp -rf * ../${{ inputs.test-directory-name }}/
cd ../../
source env.sh
./DRAWEXE -v -c testsummarize results/${{ inputs.test-directory-name }}
else
echo "No retest results to copy - directory is empty"
fi
- name: Upload updated test results (Windows)
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
uses: actions/upload-artifact@v4.4.3
with:
name: ${{ inputs.results-artifact-name }}
path: install/results/${{ inputs.test-directory-name }}*
retention-days: 15
overwrite: true
- name: Upload updated test results (macOS/Linux)
if : ${{ inputs.platform != 'windows' && steps.check_failures.outputs.failed_count > 0 }}
uses: actions/upload-artifact@v4.4.3
with:
name: ${{ inputs.results-artifact-name }}
path: install/bin/results/${{ inputs.test-directory-name }}*
retention-days: 15
overwrite: true
- name: Check test failures (Windows)
if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }}
shell: pwsh
run: |
cd install/results/${{ inputs.test-directory-name }}-retest
$failedCount = 0
if (Test-Path tests.log) {
$content = Get-Content tests.log
$totalLine = $content | Select-String "Total cases:"
if ($totalLine) {
if ($totalLine -match "FAILED") {
$failedCount = ($totalLine | ForEach-Object { $_.Line -replace '.*?(\d+) FAILED.*','$1' }) -as [int]
}
}
if ($failedCount -gt 0) {
Write-Error "Number of FAILED tests ($failedCount) exceeds threshold of 0"
echo "FAILED_COUNT=$failedCount" >> $env:GITHUB_ENV
exit 1
}
Write-Output "Found $failedCount FAILED tests"
}
- name: Check test failures (macOS/Linux)
if: ${{ inputs.platform != 'windows' && steps.check_failures.outputs.failed_count > 0 }}
shell: bash
run: |
cd install/bin/results/${{ inputs.test-directory-name }}-retest
if [ -f tests.log ]; then
TOTAL_LINE=$(grep "Total cases:" tests.log | tail -n1)
echo "Total line: $TOTAL_LINE"
if [[ $TOTAL_LINE =~ ([0-9]+)[[:space:]]FAILED ]]; then
FAILED_COUNT="${BASH_REMATCH[1]}"
if [ $FAILED_COUNT -gt 0 ]; then
echo "Number of FAILED tests ($FAILED_COUNT) exceeds threshold of 0"
echo "::error::Number of FAILED tests ($FAILED_COUNT) exceeds threshold of 0"
echo "FAILED_COUNT=$FAILED_COUNT" >> $GITHUB_ENV
exit 1
fi
fi
echo "Found 0 FAILED tests"
fi

View File

@@ -30,22 +30,10 @@ runs:
name: ${{ inputs.install-artifact-name }}
path: install
- name: Download and extract 3rdparty dependencies for Windows
if: inputs.platform == 'windows'
shell: pwsh
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
- name: Install macOS dependencies
if: inputs.platform == 'macos'
shell: bash
run: |
brew update
brew install tcl-tk tbb gl2ps xerces-c \
libxmu libxi libxft libxpm \
glew freeimage draco glfw
- name: Download vcpkg cache
uses: ./.github/actions/download-vcpkg-cache
with:
artifact-name: ${{ inputs.install-artifact-name }}-cache
- name: Install Linux dependencies
if: inputs.platform == 'linux'
@@ -69,7 +57,7 @@ runs:
shell: cmd
run: |
cd install
call env.bat ${{ inputs.compiler == 'msvc' && 'vc14' || 'clang' }} win64 release
call env.bat vc14 win64 release
cd bin
set GTEST_OUTPUT=""
OpenCascadeGTest.exe --gtest_output=xml:gtest_results.xml > gtest_output.log 2>&1
@@ -86,7 +74,7 @@ runs:
run: |
cd install/bin
source env.sh
./OpenCascadeGTest --gtest_output=xml:gtest_results.xml > gtest_output.log 2>&1
./OpenCascadeGTest --gtest_output=xml:gtest_results.xml > gtest_output.log 2>&1 || true
cat gtest_output.log
- name: Upload GTest results

166
.github/actions/run-tests/action.yml vendored Normal file
View File

@@ -0,0 +1,166 @@
name: 'Run Tests'
description: 'Run OCCT tests on a specific platform'
inputs:
platform:
description: 'Platform (windows, macos, linux)'
required: true
compiler:
description: 'Compiler (msvc, clang, gcc)'
required: true
install-artifact-name:
description: 'Name of the artifact containing the install directory'
required: true
test-directory-name:
description: 'Name of the directory to store test results'
required: true
test-script:
description: 'The test script to run'
required: true
runs:
using: "composite"
steps:
- name: Download vcpkg cache
uses: ./.github/actions/download-vcpkg-cache
with:
artifact-name: ${{ inputs.install-artifact-name }}-cache
- name: Install dependencies (Linux)
if: ${{ inputs.platform == 'linux' }}
run: sudo apt-get update && sudo apt-get install -y cmake ${{ inputs.compiler == 'gcc' && 'gcc g++' || 'clang' }} make libglu1-mesa-dev libegl1-mesa-dev fonts-noto-cjk fonts-liberation fonts-ubuntu fonts-liberation fonts-ubuntu fonts-noto-cjk fonts-ipafont-gothic fonts-ipafont-mincho fonts-unfonts-core
shell: bash
- name: Setup Xvfb and Mesa (Linux)
if: ${{ inputs.platform == 'linux' }}
uses: ./.github/actions/setup-xvfb-mesa
- name: Download and extract test data (Windows)
if: ${{ inputs.platform == 'windows' }}
run: |
cd data
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.zip -OutFile opencascade-dataset-7.9.0.zip
Expand-Archive -Path opencascade-dataset-7.9.0.zip -DestinationPath .
Remove-Item opencascade-dataset-7.9.0.zip
shell: pwsh
- name: Download test data (macOS/Linux)
if: ${{ (inputs.platform == 'macos' || inputs.platform == 'linux') }}
run: |
cd data
wget -q https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/opencascade-dataset-7.9.0.tar.xz
tar -xf opencascade-dataset-7.9.0.tar.xz
shell: bash
- name: Download and extract install directory
uses: actions/download-artifact@v4.1.7
with:
name: ${{ inputs.install-artifact-name }}
path: install
- name: Download and extract Mesa3D (Windows)
if: ${{ inputs.platform == 'windows' }}
run: |
curl -L -o mesa3d.7z https://github.com/pal1000/mesa-dist-win/releases/download/24.3.2/mesa3d-24.3.2-release-mingw.7z
7z x mesa3d.7z -omesa3d
shell: pwsh
- name: Run system-wide deployment (Windows)
if: ${{ inputs.platform == 'windows' }}
run: |
cd mesa3d
.\systemwidedeploy.cmd 1
.\systemwidedeploy.cmd 5
shell: cmd
- name: Install CJK Fonts (Windows)
if: ${{ inputs.platform == 'windows' }}
run: |
Invoke-WebRequest -Uri https://noto-website-2.storage.googleapis.com/pkgs/Noto-hinted.zip -OutFile Noto-hinted.zip
Expand-Archive -Path Noto-hinted.zip -DestinationPath $env:windir\Fonts
Remove-Item Noto-hinted.zip
shell: pwsh
- name: Set LIBGL_ALWAYS_SOFTWARE environment variable (macOS)
if: ${{ inputs.platform == 'macos' }}
run: echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV
shell: bash
- name: Set execute permissions on DRAWEXE (macOS/Linux)
if: ${{ inputs.platform == 'macos' || inputs.platform == 'linux' }}
run: chmod +x install/bin/DRAWEXE
shell: bash
- name: Run tests (Windows)
if: ${{ inputs.platform == 'windows' }}
run: |
cd install
call env.bat vc14 win64 release
DRAWEXE.exe -v -f ${{ github.workspace }}/${{ inputs.test-script }}
shell: cmd
env:
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Run tests (macOS/Linux)
if: ${{ inputs.platform == 'macos' || inputs.platform == 'linux' }}
run: |
cd install
cd bin
source env.sh
./DRAWEXE -v -f ${{ github.workspace }}/${{ inputs.test-script }}
shell: bash
env:
DISPLAY: ${{ inputs.platform == 'linux' && ':99' || '' }}
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Clean up test results (Windows)
if: ${{ inputs.platform == 'windows' }}
run: |
cd install
call env.bat vc14 win64 release
DRAWEXE.exe -v -c cleanuptest results/${{ inputs.test-directory-name }}
shell: cmd
env:
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Clean up test results (macOS/Linux)
if: ${{ inputs.platform == 'macos' || inputs.platform == 'linux' }}
run: |
cd install
cd bin
source env.sh
./DRAWEXE -v -c cleanuptest results/${{ inputs.test-directory-name }}
shell: bash
env:
DISPLAY: ${{ inputs.platform == 'linux' && ':99' || '' }}
LIBGL_ALWAYS_SOFTWARE: 1
CSF_TestScriptsPath: ${{ github.workspace }}/tests
CSF_TestDataPath: ${{ github.workspace }}/data
- name: Upload test results (Windows)
if: ${{ inputs.platform == 'windows' }}
uses: actions/upload-artifact@v4.4.3
with:
name: results-${{ inputs.test-directory-name }}
path: |
install/results/**/*.log
install/results/**/*.png
install/results/**/*.html
retention-days: 15
- name: Upload test results (macOS/Linux)
if: ${{ inputs.platform == 'macos' || inputs.platform == 'linux' }}
uses: actions/upload-artifact@v4.4.3
with:
name: results-${{ inputs.test-directory-name }}
path: |
install/bin/results/**/*.log
install/bin/results/**/*.png
install/bin/results/**/*.html
retention-days: 15

30
.github/actions/setup-msys2/action.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: 'Setup MSYS2'
description: 'Setup MSYS2 environment for MinGW builds'
inputs:
msystem:
description: 'MSYS2 subsystem (MINGW64, CLANG64, UCRT64)'
required: true
packages:
description: 'Packages to install'
required: true
dependencies:
description: 'Additional dependencies to install'
required: true
runs:
using: "composite"
steps:
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ inputs.msystem }}
update: true
install: ${{ inputs.packages }} ${{ inputs.dependencies }}
- name: Setup environment
shell: msys2 {0}
run: |
echo "Setting up environment variables..."
echo "$MSYSTEM_PREFIX/bin" >> $GITHUB_PATH
echo "CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX" >> $GITHUB_ENV

View File

@@ -0,0 +1,15 @@
name: 'Setup Ubuntu Dependencies'
description: 'Install Ubuntu dependencies and rapidjson for OCCT builds'
runs:
using: "composite"
steps:
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y ninja-build tcl-dev tk-dev cmake clang gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev libjemalloc-dev
shell: bash
- name: Install rapidjson
run: |
wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip
unzip rapidjson.zip
shell: bash

View File

@@ -0,0 +1,30 @@
name: 'Setup Windows MSVC Dependencies'
description: 'Download and setup 3rdparty dependencies and Mesa3D for Windows MSVC builds'
runs:
using: "composite"
steps:
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: x64
- name: Download and extract 3rdparty dependencies
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
- name: Download and extract Mesa3D
run: |
curl -L -o mesa3d.7z https://github.com/pal1000/mesa-dist-win/releases/download/24.3.2/mesa3d-24.3.2-release-mingw.7z
7z x mesa3d.7z -omesa3d
shell: pwsh
- name: Run system-wide deployment
run: |
cd mesa3d
.\systemwidedeploy.cmd 1
.\systemwidedeploy.cmd 5
shell: cmd

134
.github/actions/test-summary/action.yml vendored Normal file
View File

@@ -0,0 +1,134 @@
name: 'Test Summary'
description: 'Compare test results between current branch and master'
runs:
using: "composite"
steps:
- name: Download vcpkg cache
uses: ./.github/actions/download-vcpkg-cache
with:
artifact-name: install-linux-clang-x64-cache
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y cmake clang g++ make libglu1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev
shell: bash
- name: Setup Xvfb and Mesa
uses: ./.github/actions/setup-xvfb-mesa
- name: Set environment variables
run: |
echo "DISPLAY=:99" >> $GITHUB_ENV
echo "LIBGL_ALWAYS_SOFTWARE=1" >> $GITHUB_ENV
shell: bash
- name: Download and extract install directory
uses: actions/download-artifact@v4.1.7
with:
name: install-linux-clang-x64
path: install
- name: Set execute permissions on DRAWEXE
run: chmod +x install/bin/DRAWEXE
shell: bash
- name: Get latest workflow run ID from target branch
id: get_run_id
run: |
response=$(curl -s \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs?branch=${{ github.event.pull_request.base.ref }}&status=success")
latest_run_id=$(echo "$response" | jq -r \
--arg repo "${{ github.repository }}" \
'.workflow_runs[] | select(.name=="Build and Test OCCT on Multiple Platforms" and .head_repository.full_name==$repo) | .id' | head -n 1)
echo "latest_run_id=$latest_run_id" >> $GITHUB_ENV
shell: bash
- name: Download master branch test results
env:
GH_TOKEN: ${{ github.token }}
run: |
for platform in windows-x64 macos-x64 linux-clang-x64; do
echo "Downloading results for $platform"
gh run download ${{ env.latest_run_id }} -n "results-$platform" -D "install/bin/results/master/"
done
shell: bash
- name: Download current branch test results
env:
GH_TOKEN: ${{ github.token }}
run: |
for platform in windows-x64 macos-x64 linux-clang-x64; do
echo "Downloading results for $platform"
gh run download -n "results-$platform" -D "install/bin/results/current/"
done
shell: bash
- name: Compare test results
run: |
echo "Comparing test results..."
cd install/bin
source env.sh
for platform in windows-x64 macos-x64 linux-clang-x64; do
./DRAWEXE -v -c testdiff "results/current/$platform" "results/master/$platform" &
done
wait
shell: bash
- name: Install BeautifulSoup
run: pip install beautifulsoup4
shell: bash
- name: Clean unused test images
run: |
# copy to the install/bin/results directory
cp ${{ github.workspace }}/.github/actions/scripts/cleanup_test_images.py install/bin/results
cd install/bin/results
python cleanup_test_images.py
shell: bash
- name: Upload comparison results
uses: actions/upload-artifact@v4.4.3
with:
name: test-compare-results
retention-days: 15
overwrite: true
path: |
install/bin/results/**/diff-*.html
install/bin/results/**/diff-*.log
install/bin/results/**/summary.html
install/bin/results/**/tests.log
install/bin/results/**/*.png
- name: Post performance summary to PR
if: github.repository == 'Open-Cascade-SAS/OCCT' && github.head_ref == 'IR' && github.base_ref == 'master'
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
COMMENT_FILE=$(mktemp)
# Get commit ID and commit header
COMMIT_ID=$(git rev-parse HEAD)
COMMIT_HEADER=$(git log -1 --pretty=%s)
echo -e "**Performance Test Summary**\n" > "$COMMENT_FILE"
echo -e "**Commit**: \`${COMMIT_ID}\`\n" >> "$COMMENT_FILE"
echo -e "**Title**: ${COMMIT_HEADER}\n" >> "$COMMENT_FILE"
LOG_FILES=$(find install/bin/results/current -name "diff-*.log")
if [ -z "$LOG_FILES" ]; then
echo "No diff logs found." >> "$COMMENT_FILE"
else
for log_file in $LOG_FILES; do
PLATFORM=$(basename $(dirname "$log_file"))
echo "**Platform: ${PLATFORM}**" >> "$COMMENT_FILE"
echo '```' >> "$COMMENT_FILE"
grep -E "Total (MEMORY|CPU|IMAGE) difference:" "$log_file" >> "$COMMENT_FILE" || echo "No performance summary found." >> "$COMMENT_FILE"
echo '```' >> "$COMMENT_FILE"
echo "" >> "$COMMENT_FILE"
done
fi
gh pr comment ${PR_NUMBER} --body-file "$COMMENT_FILE"
rm "$COMMENT_FILE"
shell: bash

View File

@@ -17,7 +17,13 @@ set exclude_list [list \
"chamfer dist_angle_complex A4" \
"chamfer dist_angle_complex A5" \
"chamfer dist_angle_sequence A1" \
"chamfer dist_angle_sequence A4"
"chamfer dist_angle_sequence A4" \
"caf basic W12" \
"opengles3 general msaa" \
"opengles3 geom interior1" \
"opengles3 geom interior2" \
"opengles3 shadows dir2" \
"opengles3 textures alpha_mask"
]
set exclude_str [join $exclude_list ,]

View File

@@ -18,7 +18,14 @@ set exclude_list [list \
"chamfer dist_angle_complex A4" \
"chamfer dist_angle_complex A5" \
"chamfer dist_angle_sequence A1" \
"chamfer dist_angle_sequence A4"
"chamfer dist_angle_sequence A4" \
"bugs fclasses bug30775" \
"caf basic W12" \
"opengles3 general msaa" \
"opengles3 geom interior1" \
"opengles3 geom interior2" \
"opengles3 shadows dir2" \
"opengles3 textures alpha_mask"
]
set exclude_str [join $exclude_list ,]

View File

@@ -0,0 +1,33 @@
name: 'Upload vcpkg Cache'
description: 'Upload vcpkg installed packages and cache for reuse'
inputs:
artifact-name:
description: 'Name of the artifact to store vcpkg cache'
required: true
build-directory:
description: 'Build directory containing vcpkg_installed'
required: false
default: 'build'
runs:
using: "composite"
steps:
- name: Create vcpkg tar archive
run: |
cd ${{ inputs.build-directory }}
tar -czf vcpkg-dependencies.tar.gz \
--exclude='vcpkg_installed/*/debug' \
--exclude='vcpkg_installed/**/*.pdb' \
--exclude='vcpkg_installed/**/*.lib' \
./vcpkg_installed/
shell: bash
- name: Upload vcpkg tar archive
uses: actions/upload-artifact@v4.4.3
with:
name: ${{ inputs.artifact-name }}
path: ${{ inputs.build-directory }}/vcpkg-dependencies.tar.gz
retention-days: 7
compression-level: 1

110
.github/actions/vcpkg-setup/action.yml vendored Normal file
View File

@@ -0,0 +1,110 @@
name: 'Setup vcpkg'
description: 'Setup vcpkg dependencies for OCCT build on a specific platform'
inputs:
vcpkg-tag:
description: 'vcpkg tag to checkout'
required: false
default: '2025.06.13'
github-token:
description: 'GitHub token for NuGet package access'
required: true
runs:
using: "composite"
steps:
- name: Set environment variables
run: |
echo "USERNAME=Open-Cascade-SAS" >> $GITHUB_ENV
echo "VCPKG_ROOT=${{ github.workspace }}/vcpkg" >> $GITHUB_ENV
echo "VCPKG_EXE=${{ github.workspace }}/vcpkg/vcpkg" >> $GITHUB_ENV
echo "FEED_URL=https://nuget.pkg.github.com/Open-Cascade-SAS/index.json" >> $GITHUB_ENV
echo "VCPKG_BINARY_SOURCES=clear;nuget,https://nuget.pkg.github.com/Open-Cascade-SAS/index.json,readwrite" >> $GITHUB_ENV
echo "VCPKG_FEATURE_FLAGS=binarycaching,manifests,versions" >> $GITHUB_ENV
echo "VCPKG_DISABLE_COMPILER_TRACKING=1" >> $GITHUB_ENV
shell: bash
if: runner.os != 'Windows'
- name: Set environment variables (Windows)
run: |
echo "USERNAME=Open-Cascade-SAS" >> $env:GITHUB_ENV
echo "VCPKG_ROOT=${{ github.workspace }}/vcpkg" >> $env:GITHUB_ENV
echo "VCPKG_EXE=${{ github.workspace }}/vcpkg/vcpkg" >> $env:GITHUB_ENV
echo "FEED_URL=https://nuget.pkg.github.com/Open-Cascade-SAS/index.json" >> $env:GITHUB_ENV
echo "VCPKG_BINARY_SOURCES=clear;nuget,https://nuget.pkg.github.com/Open-Cascade-SAS/index.json,readwrite" >> $env:GITHUB_ENV
echo "VCPKG_FEATURE_FLAGS=binarycaching,manifests,versions" >> $env:GITHUB_ENV
echo "VCPKG_DISABLE_COMPILER_TRACKING=1" >> $env:GITHUB_ENV
shell: pwsh
if: runner.os == 'Windows'
- name: Install required packages (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential ninja-build curl zip unzip tar nasm autoconf mono-complete \
libx11-dev \
libxi-dev \
libxext-dev \
mesa-common-dev \
libglu1-mesa-dev \
libegl1-mesa-dev \
libgles2-mesa-dev
shell: bash
- name: Install required packages (macOS)
if: runner.os == 'macOS'
run: |
brew update || true
brew install cmake ninja nasm autoconf automake mono openexr || true
brew install --cask xquartz || true
shell: bash
- name: Set up vcpkg (Unix)
if: runner.os != 'Windows'
run: |
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
git checkout ${{ inputs.vcpkg-tag }}
./bootstrap-vcpkg.sh
shell: bash
- name: Set up vcpkg (Windows)
if: runner.os == 'Windows'
run: |
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
git checkout ${{ inputs.vcpkg-tag }}
.\bootstrap-vcpkg.bat
shell: cmd
- name: Add NuGet sources
if: runner.os == 'Windows'
run: |
.$(${{ env.VCPKG_EXE }} fetch nuget) `
sources add `
-Source "${{ env.FEED_URL }}" `
-StorePasswordInClearText `
-Name GitHubPackages `
-UserName "${{ env.USERNAME }}" `
-Password "${{ inputs.github-token }}"
.$(${{ env.VCPKG_EXE }} fetch nuget) `
setapikey "${{ inputs.github-token }}" `
-Source "${{ env.FEED_URL }}"
shell: pwsh
- name: Add NuGet sources
if: runner.os != 'Windows'
run: |
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \
sources add \
-Source "${{ env.FEED_URL }}" \
-StorePasswordInClearText \
-Name GitHubPackages \
-UserName "${{ env.USERNAME }}" \
-Password "${{ inputs.github-token }}"
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \
setapikey "${{ inputs.github-token }}" \
-Source "${{ env.FEED_URL }}"
shell: bash

247
.github/copilot-instructions.md vendored Normal file
View File

@@ -0,0 +1,247 @@
# OCCT Copilot Instructions
This file provides the comprehensive guidance for AI assistants working with the Open CASCADE Technology (OCCT) C++17+ 3D CAD/CAM/CAE library.
---
## 1. Core Directives for AI Assistant
> **IMPORTANT:** These are the most critical rules. Follow them strictly.
1. **Memory Management is Paramount:**
- **ALWAYS** use `Handle(ClassName)` for any class inheriting from `Standard_Transient` (e.g., `Geom_*`, `Poly_*`, `AIS_*`, `V3d_*`). This is for reference-counted objects.
- **NEVER** use raw pointers (`ClassName*`) for these types, as it will cause memory leaks.
- **Correct:** `Handle(Geom_Circle) aCircle = new Geom_Circle(...);`
- **Wrong:** `Geom_Circle* aCircle = new Geom_Circle(...);`
2. **Check Operation Status:**
- After using an API that performs a geometric operation (e.g., `BRepAlgoAPI_Fuse`, `BRepBuilderAPI_MakeEdge`), **ALWAYS** check if the operation was successful using the `IsDone()` method before accessing the result.
- **Correct:**
```cpp
BRepAlgoAPI_Fuse aFuser(theShape1, theShape2);
if (aFuser.IsDone()) {
auto aResult = aFuser.Shape();
} else {
// Handle error
}
```
3. **Strict Naming and File Conventions:**
- Adhere to the strict `Package_ClassName` convention.
- Place new files in the correct directory: `src/Module/Toolkit/Package/`.
- After adding a file, **ALWAYS** update the corresponding `src/Module/Toolkit/FILES.cmake` file.
4. **Use Modern C++ Idioms:**
- Prefer `auto` for variable declarations where the type is clear, especially with iterators.
- Use range-based `for` loops and structured bindings where applicable.
- Use the modern `TopExp_Explorer` constructor style.
- **Correct:** `for (TopExp_Explorer anExp(theShape, TopAbs_FACE); anExp.More(); anExp.Next()) { ... }`
- **Wrong:** `for (TopExp_Explorer anExp; anExp.Init(theShape, TopAbs_FACE); anExp.More(); anExp.Next()) { ... }`
5. **Safe Type Casting:**
- When downcasting topological shapes, **ALWAYS** use the `TopoDS` helper functions to avoid errors.
- **Correct:** `auto aFace = TopoDS::Face(anExp.Current());`
- **Wrong:** `auto aFace = (const TopoDS_Face&)anExp.Current();`
6. **Handle Downcasting:**
- Use `Handle(DerivedClass)::DownCast(BaseHandle)` to safely downcast handles.
- **Correct:**
```cpp
Handle(Geom_Circle) circ = Handle(Geom_Circle)::DownCast(someCurveHandle);
```
- **Wrong:**
```cpp
// Do not use C-style casts on handles
Geom_Circle* circ = (Geom_Circle*)someHandle.Get();
```
7. **Validate Handles for Null Safety:**
- **ALWAYS** check that a `Handle(ClassName)` is not null before dereferencing it:
```cpp
if (!theHandle.IsNull()) {
// use theHandle
}
```
---
## 2. Project Overview
Open CASCADE Technology (OCCT) is a comprehensive C++ software development platform for 3D surface and solid modeling, CAD data exchange, and visualization. It's a modern C++17+ library providing services for CAD/CAM/CAE applications.
### Architecture & Source Organization
- **`src/`**: Source code, organized by a `Module/Toolkit/Package` hierarchy.
- **`tests/`**: Draw Harness test files, organized by functionality.
- **`adm/`**: Administrative and build configuration files (CMake).
- **`samples/`**: Example applications.
---
## 3. Code Conventions
### Naming Patterns
| Element Type | Pattern | Example |
| --------------------------- | ---------------------------- | -------------------------------- |
| **Classes** | `Package_ClassName` | `TopoDS_Shape`, `BRep_Builder` |
| **Public Methods** | `MethodName` | `IsDone()`, `Shape()` |
| **Private Methods** | `methodName` | `myInternalMethod()` |
| **Method Parameters** | `theParameterName` | `theShape`, `theTolerance` |
| **Local Variables** | `aVariableName` | `aBox`, `anExplorer` |
| **Class Member Fields** | `myFieldName` | `myShape`, `myIsDone` |
| **Struct Member Fields** | `FieldVariableName` | `Point`, `Value` |
| **Global Variables** | `THE_GLOBAL_VARIABLE` | `THE_DEFAULT_PRECISION` |
### Type Mappings
| OCCT Type | C++ Equivalent | Notes |
| ------------------- | -------------- | ----------------------------------- |
| `Standard_Real` | `double` | Use for all floating-point numbers. |
| `Standard_Integer` | `int` | Use for all integer values. |
| `Standard_Boolean` | `bool` | Use for `true`/`false` values. |
### Modern C++ Encouraged
This is a C++17+ codebase. Proactively use modern features to improve code quality:
- `auto`
- Range-based `for` loops
- Structured bindings: `for (const auto& [key, value] : aMap)`
- `std::optional` for optional return values where appropriate.
- `if constexpr` for compile-time conditions.
---
## 4. Step-by-Step Workflow Example: Adding a New Class and Test
This example demonstrates the end-to-end process for adding a new class `BRepTest_MyNewClass` to the `TKTopAlgo` toolkit and creating a corresponding GTest.
**1. Create Header and Source Files:**
Navigate to the correct package directory and create the files.
```bash
# Navigate to the BRepTest package in the ModelingAlgorithms module
cd src/ModelingAlgorithms/TKTopAlgo/BRepTest
touch BRepTest_MyNewClass.hxx BRepTest_MyNewClass.cxx
```
**2. Implement the Class:**
Add content to `BRepTest_MyNewClass.hxx` and `.cxx`, following all code conventions.
**3. Add Files to CMake:**
Edit the toolkit's `FILES.cmake` to register the new files.
```bash
# Edit the CMake file for TKTopAlgo
vim src/ModelingAlgorithms/TKTopAlgo/FILES.cmake
```
Add the new files to the `OCCT_<PackageName>_FILES` list:
```cmake
# In FILES.cmake
...
set (OCCT_BRepTest_FILES
...
BRepTest_MyNewClass.hxx
BRepTest_MyNewClass.cxx
...
)
```
**4. Create a GTest:**
Navigate to the GTest directory for the toolkit and create a test file.
```bash
# Navigate to the GTest directory for TKTopAlgo
cd src/ModelingAlgorithms/TKTopAlgo/GTests
touch BRepTest_MyNewClass_Test.cxx
```
Write the test implementation in the new file.
**5. Add GTest to CMake:**
Edit the same `FILES.cmake` to add the test file.
```cmake
# In FILES.cmake
...
set (OCCT_TKTopAlgo_GTests_FILES
...
GTests/BRepTest_MyNewClass_Test.cxx
...
)
```
**6. Build and Run Test:**
From the `build` directory, build the project and run the tests.
```bash
# Navigate to build directory
cd build
# Re-run CMake to pick up new files (usually not needed, but good practice)
cmake .. -DBUILD_GTEST=ON
# Build the project
cmake --build . --config Release
# Run the tests
./bin/OpenCascadeGTest --gtest_filter=*MyNewClass*
```
---
## 5. Build and Test System
### Build System (CMake)
- **Primary build system:** CMake 3.16+ recommended.
- **Build Directory:** Always build in a separate directory (e.g., `build/`).
- **Quick Build:**
```bash
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_GTEST=ON
cmake --build . --config Release --parallel
```
- **Environment:** Before running any OCCT executable (including tests), you **must** source the environment script: `source build/env.sh` (or `build\env.bat` on Windows).
### Testing Frameworks
- **Draw Harness:** Tcl-based framework for interactive testing. Located in `tests/`. Run with `build/DRAWEXE`.
- **GTest:** C++ unit testing framework. Tests are located in `src/.../GTests/`. Enable with `-DBUILD_GTEST=ON`.
---
## 6. Common Patterns & Key Packages
### Common Operations
- **Shape Creation:** Use `BRepPrimAPI_` classes (`MakeBox`, `MakeCylinder`).
- **Boolean Operations:** Use `BRepAlgoAPI_` classes (`Fuse`, `Cut`, `Common`).
- **Shape Exploration:** Use `TopExp_Explorer`.
- **Transformations:** Use `gp_Trsf` and `BRepBuilderAPI_Transform`.
### Key Packages
| Package | Purpose | Module |
| ----------- | ------------------------------------- | --------------------- |
| `gp` | Geometric Primitives (Points, Vecs) | FoundationClasses |
| `Geom` | Geometric entities (Curves, Surfaces) | ModelingData |
| `TopoDS` | Topological Data Structures (Shapes) | ModelingData |
| `TopExp` | Exploring topological shapes | ModelingData |
| `BRepAlgoAPI` | High-level modeling algorithms | ModelingAlgorithms |
| `BRepPrimAPI` | Geometric primitives creation | ModelingAlgorithms |
| `AIS` | Application Interactive Services | Visualization |
### Common Headers
```cpp
#include <Standard_Failure.hxx>
#include <Handle_Geom_Circle.hxx>
#include <gp_Pnt.hxx>
#include <gp_Trsf.hxx>
#include <TopoDS.hxx>
#include <TopoDS_Face.hxx>
#include <TopExp_Explorer.hxx>
#include <BRep_Builder.hxx>
#include <BRepAlgoAPI_Fuse.hxx>
#include <BRepBuilderAPI_Transform.hxx>
#include <BRepPrimAPI_MakeBox.hxx>
```
---
## 7. Key Files & Platform Notes
- **`adm/MODULES`**: Defines all modules and toolkits.
- **`src/*/FILES.cmake`**: Lists all source/header files for a toolkit. **You must edit this when adding/removing files.**
- **`build/env.sh/bat`**: The crucial environment script.

File diff suppressed because it is too large Load Diff

View File

@@ -1,219 +0,0 @@
# This workflow validates the build on Windows using MinGW and MSYS2.
# It is triggered on pushes to the master branch.
# The workflow includes steps to install dependencies, configure, build, and clean up the project.
name: MinGW build validation
on:
push:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
main_job:
name: Windows MinGW validation
runs-on: windows-2022
strategy:
matrix:
config:
- {
name: "GCC",
cc: "x86_64-w64-mingw32-gcc",
cxx: "x86_64-w64-mingw32-g++",
package: "mingw-w64-x86_64-toolchain",
thirdparty_dir: "/mingw64",
compiler_flags: "",
dependencies: "mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-rapidjson mingw-w64-x86_64-freetype mingw-w64-x86_64-draco mingw-w64-x86_64-freeimage mingw-w64-x86_64-tbb mingw-w64-x86_64-tk mingw-w64-x86_64-tcl mingw-w64-x86_64-openvr mingw-w64-x86_64-jemalloc mingw-w64-x86_64-mesa mingw-w64-x86_64-angleproject mingw-w64-x86_64-llvm-openmp mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
}
- {
name: "Clang",
cc: "clang",
cxx: "clang++",
package: "mingw-w64-clang-x86_64-toolchain",
thirdparty_dir: "/clang64",
compiler_flags: "-D CMAKE_CXX_FLAGS=\"-Wall -Wextra\" -D CMAKE_C_FLAGS=\"-Wall -Wextra\"",
dependencies: "mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-ninja mingw-w64-clang-x86_64-rapidjson mingw-w64-clang-x86_64-freetype mingw-w64-clang-x86_64-draco mingw-w64-clang-x86_64-freeimage mingw-w64-clang-x86_64-tbb mingw-w64-clang-x86_64-tk mingw-w64-clang-x86_64-tcl mingw-w64-clang-x86_64-openvr mingw-w64-clang-x86_64-jemalloc mingw-w64-clang-x86_64-mesa mingw-w64-clang-x86_64-angleproject mingw-w64-clang-x86_64-llvm-openmp mingw-w64-clang-x86_64-winpthreads-git mingw-w64-clang-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
}
- {
name: "UCRT",
cc: "x86_64-w64-mingw32-gcc",
cxx: "x86_64-w64-mingw32-g++",
package: "mingw-w64-ucrt-x86_64-toolchain",
thirdparty_dir: "/ucrt64",
compiler_flags: "",
dependencies: "mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-gcc-libs mingw-w64-ucrt-x86_64-omp mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-ninja mingw-w64-ucrt-x86_64-rapidjson mingw-w64-ucrt-x86_64-freetype mingw-w64-ucrt-x86_64-draco mingw-w64-ucrt-x86_64-freeimage mingw-w64-ucrt-x86_64-tbb mingw-w64-ucrt-x86_64-tk mingw-w64-ucrt-x86_64-tcl mingw-w64-ucrt-x86_64-openvr mingw-w64-ucrt-x86_64-jemalloc mingw-w64-ucrt-x86_64-mesa mingw-w64-ucrt-x86_64-angleproject mingw-w64-ucrt-x86_64-llvm-openmp mingw-w64-ucrt-x86_64-winpthreads-git mingw-w64-ucrt-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
}
build_type: [Debug, Release]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: ${{ matrix.config.name == 'Clang' && 'CLANG64' || matrix.config.name == 'UCRT' && 'UCRT64' || 'MINGW64' }}
update: true
install: ${{ matrix.config.package }} ${{ matrix.config.dependencies }}
- name: Setup environment
shell: msys2 {0}
run: |
echo "Checking compiler version:"
${{ matrix.config.cc }} --version
echo "Checking CMake version:"
cmake --version
echo "Setting up environment variables..."
echo "$MSYSTEM_PREFIX/bin" >> $GITHUB_PATH
echo "CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX" >> $GITHUB_ENV
- name: Configure basic
shell: msys2 {0}
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
${{ matrix.config.compiler_flags }} ..
- name: Build basic
shell: msys2 {0}
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
shell: pwsh
run: |
Remove-Item -Recurse -Force build
- name: Configure full shared
shell: msys2 {0}
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
-D BUILD_USE_PCH=OFF \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Production \
-D BUILD_LIBRARY_TYPE=Shared \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D USE_MMGR_TYPE=JEMALLOC \
-D INSTALL_DIR="${{ github.workspace }}/install-${{ matrix.build_type }}" \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=OFF \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
${{ matrix.config.compiler_flags }} ..
- name: Build full shared
shell: msys2 {0}
run: |
cd build
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
shell: pwsh
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install-${{ matrix.build_type }}
- name: Configure full static
shell: msys2 {0}
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
-D BUILD_USE_PCH=OFF \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Default \
-D BUILD_LIBRARY_TYPE=Static \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D USE_MMGR_TYPE=JEMALLOC \
-D INSTALL_DIR="${{ github.workspace }}/install-${{ matrix.build_type }}" \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=OFF \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
${{ matrix.config.compiler_flags }} ..
- name: Build full static
shell: msys2 {0}
run: |
cd build
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
shell: pwsh
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install-${{ matrix.build_type }}
- name: Configure full with DEBUG define
shell: msys2 {0}
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D CMAKE_PREFIX_PATH=$MSYSTEM_PREFIX \
-D BUILD_WITH_DEBUG=ON \
-D BUILD_USE_PCH=OFF \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Production \
-D BUILD_LIBRARY_TYPE=Shared \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D INSTALL_DIR="${{ github.workspace }}/install-${{ matrix.build_type }}" \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=OFF \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
${{ matrix.config.compiler_flags }} ..
- name: Build full with DEBUG define
shell: msys2 {0}
run: |
cd build
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
shell: pwsh
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install-${{ matrix.build_type }}

View File

@@ -1,213 +0,0 @@
# This workflow validates the build on Windows using MSVC and Clang compilers.
# It is triggered on pushes to the master branch.
# The workflow includes steps to install dependencies, configure, build, and clean up the project for different configurations.
name: MSVC build validation
on:
push:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
main_job:
name: Windows MSVC/Clang validation
runs-on: windows-2022
strategy:
matrix:
config:
- {
name: "MSVC",
cc: "cl",
cxx: "cl",
generator: "Visual Studio 17 2022",
toolset: "host=x64",
c_flags: "/W4 /WX",
cxx_flags: "/W4 /WX"
}
- {
name: "Clang",
cc: "clang",
cxx: "clang++",
generator: "Ninja",
toolset: "",
c_flags: "-Werror -Wall -Wextra -Wno-unknown-warning-option",
cxx_flags: "-Werror -Wall -Wextra -Wno-unknown-warning-option"
}
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: x64
- name: Download and extract 3rdparty dependencies
run: |
Invoke-WebRequest -Uri https://github.com/Open-Cascade-SAS/OCCT/releases/download/V7_9_0_beta1/3rdparty-vc14-64.zip -OutFile 3rdparty-vc14-64.zip
Expand-Archive -Path 3rdparty-vc14-64.zip -DestinationPath .
Remove-Item 3rdparty-vc14-64.zip
shell: pwsh
- name: Download and extract Mesa3D
run: |
curl -L -o mesa3d.7z https://github.com/pal1000/mesa-dist-win/releases/download/24.3.2/mesa3d-24.3.2-release-mingw.7z
7z x mesa3d.7z -omesa3d
- name: Run system-wide deployment
run: |
cd mesa3d
.\systemwidedeploy.cmd 1
.\systemwidedeploy.cmd 5
shell: cmd
- name: Configure basic
run: |
mkdir build
cd build
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D CMAKE_CXX_FLAGS="${{ matrix.config.cxx_flags }}" `
-D CMAKE_C_FLAGS="${{ matrix.config.c_flags }}" ..
shell: pwsh
- name: Build basic
run: |
cd build
cmake --build . --config Release
shell: pwsh
- name: Clear up after build
run: |
Remove-Item -Recurse -Force build
shell: pwsh
- name: Configure full shared
run: |
mkdir build
cd build
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
-D BUILD_USE_PCH=OFF `
-D BUILD_INCLUDE_SYMLINK=ON `
-D BUILD_OPT_PROFILE=Production `
-D BUILD_LIBRARY_TYPE=Shared `
-D CMAKE_BUILD_TYPE=Debug `
-D INSTALL_DIR=${{ github.workspace }}/install `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D USE_MMGR_TYPE=JEMALLOC `
-D USE_FREETYPE=ON `
-D USE_DRACO=ON `
-D USE_FFMPEG=ON `
-D USE_FREEIMAGE=ON `
-D USE_GLES2=ON `
-D USE_OPENVR=ON `
-D USE_VTK=${{ matrix.config.name == 'MSVC' && 'ON' || 'OFF' }} `
-D USE_TBB=ON `
-D USE_RAPIDJSON=ON `
-D USE_OPENGL=ON `
-D CMAKE_CXX_FLAGS="${{ matrix.config.cxx_flags }}" `
-D CMAKE_C_FLAGS="${{ matrix.config.c_flags }}" ..
shell: pwsh
- name: Build full shared
run: |
cd build
cmake --build . --target install --config Debug
shell: pwsh
- name: Clear up after build
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install
shell: pwsh
- name: Configure full static
run: |
mkdir build
cd build
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
-D BUILD_USE_PCH=OFF `
-D BUILD_INCLUDE_SYMLINK=ON `
-D BUILD_OPT_PROFILE=Default `
-D BUILD_LIBRARY_TYPE=Static `
-D CMAKE_BUILD_TYPE=Debug `
-D INSTALL_DIR=${{ github.workspace }}/install `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D USE_MMGR_TYPE=JEMALLOC `
-D USE_FREETYPE=ON `
-D USE_DRACO=ON `
-D USE_FFMPEG=ON `
-D USE_FREEIMAGE=ON `
-D USE_GLES2=ON `
-D USE_OPENVR=ON `
-D USE_VTK=OFF `
-D USE_TBB=ON `
-D USE_RAPIDJSON=ON `
-D USE_OPENGL=ON `
-D CMAKE_CXX_FLAGS="${{ matrix.config.cxx_flags }}" `
-D CMAKE_C_FLAGS="${{ matrix.config.c_flags }}" ..
shell: pwsh
- name: Build full static
run: |
cd build
cmake --build . --target install --config Debug
shell: pwsh
- name: Clear up after build
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install
shell: pwsh
- name: Configure full with DEBUG define
run: |
mkdir build
cd build
cmake -G "${{ matrix.config.generator }}" ${{ matrix.config.toolset }} `
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} `
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} `
-D BUILD_WITH_DEBUG=ON `
-D BUILD_USE_PCH=OFF `
-D BUILD_INCLUDE_SYMLINK=ON `
-D BUILD_OPT_PROFILE=Production `
-D BUILD_LIBRARY_TYPE=Shared `
-D CMAKE_BUILD_TYPE=Debug `
-D INSTALL_DIR=${{ github.workspace }}/install `
-D 3RDPARTY_DIR=${{ github.workspace }}/3rdparty-vc14-64 `
-D USE_FREETYPE=ON `
-D USE_DRACO=ON `
-D USE_FFMPEG=ON `
-D USE_FREEIMAGE=ON `
-D USE_GLES2=ON `
-D USE_OPENVR=ON `
-D USE_VTK=${{ matrix.config.name == 'MSVC' && 'ON' || 'OFF' }} `
-D USE_TBB=ON `
-D USE_RAPIDJSON=ON `
-D USE_OPENGL=ON ` ..
shell: pwsh
- name: Build full with DEBUG define
run: |
cd build
cmake --build . --target install --config Debug
shell: pwsh
- name: Clear up after build
run: |
Remove-Item -Recurse -Force build
Remove-Item -Recurse -Force ${{ github.workspace }}/install
shell: pwsh

View File

@@ -1,180 +0,0 @@
# This workflow validates the build on the latest Ubuntu version (24.04) using multiple configurations.
# It is triggered on pushes to the master branch.
# The workflow includes steps to install dependencies, configure, build, and clean up the project for different configurations.
name: Ubuntu build validation
on:
push:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
main_job:
name: Latest ubuntu validation
runs-on: ubuntu-24.04
strategy:
matrix:
config:
- {
name: "GCC",
cc: "gcc",
cxx: "g++",
compiler_flags: ""
}
- {
name: "Clang",
cc: "clang",
cxx: "clang++",
compiler_flags: "-D CMAKE_CXX_FLAGS=\"-Werror -Wall -Wextra\" -D CMAKE_C_FLAGS=\"-Werror -Wall -Wextra\""
}
build_type: [Debug, Release]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y ninja-build tcl-dev tk-dev cmake clang gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev tcllib tcl-thread tcl libvtk9-dev libopenvr-dev libdraco-dev libfreeimage-dev libegl1-mesa-dev libgles2-mesa-dev libfreetype-dev libjemalloc-dev
- name: Install rapidjson
run: |
wget https://github.com/Tencent/rapidjson/archive/858451e5b7d1c56cf8f6d58f88cf958351837e53.zip -O rapidjson.zip
unzip rapidjson.zip
- name: Configure basic
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
${{ matrix.config.compiler_flags }} ..
- name: Build basic
run: |
cd build
cmake --build . --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
run: |
rm -rf build
- name: Configure full shared
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D BUILD_USE_PCH=OFF \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Production \
-D BUILD_LIBRARY_TYPE=Shared \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D USE_MMGR_TYPE=JEMALLOC \
-D INSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=ON \
-D USE_TBB=ON \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
${{ matrix.config.compiler_flags }} ..
- name: Build full shared
run: |
cd build
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
run: |
rm -rf build
rm -rf ${{ github.workspace }}/install-${{ matrix.build_type }}
- name: Configure full static
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D BUILD_USE_PCH=OFF \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Default \
-D BUILD_LIBRARY_TYPE=Static \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D USE_MMGR_TYPE=JEMALLOC \
-D INSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=OFF \
-D USE_TBB=ON \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON \
${{ matrix.config.compiler_flags }} ..
- name: Build full static
run: |
cd build
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
run: |
rm -rf build
rm -rf ${{ github.workspace }}/install-${{ matrix.build_type }}
- name: Configure full with DEBUG define
run: |
mkdir -p build
cd build
cmake -G "Ninja" \
-D CMAKE_C_COMPILER=${{ matrix.config.cc }} \
-D CMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
-D BUILD_WITH_DEBUG=ON \
-D BUILD_USE_PCH=OFF \
-D BUILD_INCLUDE_SYMLINK=ON \
-D BUILD_OPT_PROFILE=Production \
-D BUILD_LIBRARY_TYPE=Shared \
-D USE_TK=ON \
-D CMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-D INSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
-D 3RDPARTY_RAPIDJSON_DIR=${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53 \
-D USE_FREETYPE=ON \
-D USE_DRACO=ON \
-D USE_FFMPEG=OFF \
-D USE_FREEIMAGE=ON \
-D USE_GLES2=ON \
-D USE_OPENVR=ON \
-D USE_VTK=ON \
-D USE_TBB=ON \
-D USE_RAPIDJSON=ON \
-D USE_OPENGL=ON ..
- name: Build full with DEBUG define
run: |
cd build
cmake --build . --target install --config ${{ matrix.build_type }} -- -j 4
- name: Clear up after build
run: |
rm -rf build
rm -rf ${{ github.workspace }}/install-${{ matrix.build_type }}

View File

@@ -1,102 +0,0 @@
# This workflow validates the WebAssembly build on Ubuntu.
# It is triggered on pushes to the master branch.
# The workflow includes steps to install dependencies, configure, build, and clean up the project.
name: WebAssembly build (Ubuntu)
on:
push:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
env:
USERNAME: Open-Cascade-SAS
VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg
FEED_URL: https://nuget.pkg.github.com/Open-Cascade-SAS/index.json
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/Open-Cascade-SAS/index.json,readwrite"
EMSDK_VERSION: 3.1.74
jobs:
wasm-build:
name: WebAssembly Build
runs-on: ubuntu-24.04
strategy:
matrix:
build_type: [Debug, Release]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential ninja-build curl zip unzip tar nasm autoconf mono-complete
sudo apt-get install -y libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev
- name: Setup vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
- name: Add NuGet sources
run: |
mono $(${VCPKG_EXE} fetch nuget | tail -n 1) \
sources add \
-Source "${FEED_URL}" \
-StorePasswordInClearText \
-Name GitHubPackages \
-UserName "${USERNAME}" \
-Password "${{ secrets.GITHUB_TOKEN }}"
mono $(${VCPKG_EXE} fetch nuget | tail -n 1) \
setapikey "${{ secrets.GITHUB_TOKEN }}" \
-Source "${FEED_URL}"
- name: Setup Emscripten
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install ${EMSDK_VERSION}
./emsdk activate ${EMSDK_VERSION}
echo "EMSDK=${{ github.workspace }}/emsdk" >> $GITHUB_ENV
echo "${{ github.workspace }}/emsdk" >> $GITHUB_PATH
echo "${{ github.workspace }}/emsdk/upstream/emscripten" >> $GITHUB_PATH
- name: Configure OCCT with vcpkg
run: |
source "${{ github.workspace }}/emsdk/emsdk_env.sh"
mkdir -p "build-${{ matrix.build_type }}"
cd "build-${{ matrix.build_type }}"
export VCPKG_ROOT="${{ github.workspace }}/vcpkg"
emcmake cmake -G "Ninja" \
-DCMAKE_TOOLCHAIN_FILE="${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" \
-DVCPKG_TARGET_TRIPLET=wasm32-emscripten \
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE="$EMSDK/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake" \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_USE_VCPKG=ON \
-DUSE_MMGR_TYPE=NATIVE \
-DBUILD_LIBRARY_TYPE=Static \
-DBUILD_MODULE_Draw=OFF \
-DUSE_FREETYPE=OFF \
-DUSE_TK=OFF \
-DUSE_TCL=OFF \
-DUSE_DRACO=ON \
-DUSE_FFMPEG=OFF \
-DUSE_FREEIMAGE=OFF \
-DUSE_OPENVR=OFF \
-DUSE_VTK=OFF \
-DUSE_TBB=OFF \
-DUSE_RAPIDJSON=ON \
-DINSTALL_DIR="${{ github.workspace }}/install-wasm-${{ matrix.build_type }}" \
-DCMAKE_CXX_FLAGS="-s WASM=1 -s EXPORTED_RUNTIME_METHODS=['ccall','cwrap'] -s ALLOW_MEMORY_GROWTH=1" \
-DCMAKE_EXECUTABLE_SUFFIX=".js" ..
- name: Build
run: |
cd build-${{ matrix.build_type }}
cmake --build . --config ${{ matrix.build_type }} --target install -- -j4

View File

@@ -1,170 +0,0 @@
# This workflow builds OCCT using vcpkg on multiple platforms (Windows, macOS, Linux).
# It builds in both Debug and Release modes.
# All dependencies except the compiler are installed using vcpkg.
# The workflow includes steps to clone vcpkg, install dependencies, configure and build.
name: Build OCCT with vcpkg
on:
push:
branches:
- 'master'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
env:
USERNAME: Open-Cascade-SAS
VCPKG_EXE: ${{ github.workspace }}/vcpkg/vcpkg
FEED_URL: https://nuget.pkg.github.com/Open-Cascade-SAS/index.json
VCPKG_BINARY_SOURCES: "clear;nuget,https://nuget.pkg.github.com/Open-Cascade-SAS/index.json,readwrite"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, ubuntu-22.04, windows-2022, windows-2019, macos-15, macos-14, macos-13]
build_type: [Debug, Release]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Install required packages (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential ninja-build curl zip unzip tar nasm autoconf mono-complete
sudo apt-get install -y libxi-dev libgl1-mesa-dev libglu1-mesa-dev mesa-common-dev libxrandr-dev libxxf86vm-dev
- name: Install required packages (macOS)
if: runner.os == 'macOS'
run: |
brew update || true
brew install cmake ninja nasm autoconf mono || true
# temporary workaround for missing tcl-tk
brew install tcl-tk || true
# Force link any conflicting packages
brew link --overwrite python@3.12 || true
brew link --overwrite python@3.13 || true
- name: Install required packages (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1.13.0
with:
arch: x64
- name: Set up vcpkg (Unix)
if: runner.os != 'Windows'
run: |
git clone https://github.com/microsoft/vcpkg.git
./vcpkg/bootstrap-vcpkg.sh
shell: bash
- name: Set up vcpkg (Windows)
if: runner.os == 'Windows'
run: |
git clone https://github.com/microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
shell: cmd
- name: Add NuGet sources
if: runner.os == 'Windows'
run: |
.$(${{ env.VCPKG_EXE }} fetch nuget) `
sources add `
-Source "${{ env.FEED_URL }}" `
-StorePasswordInClearText `
-Name GitHubPackages `
-UserName "${{ env.USERNAME }}" `
-Password "${{ secrets.GITHUB_TOKEN }}"
.$(${{ env.VCPKG_EXE }} fetch nuget) `
setapikey "${{ secrets.GITHUB_TOKEN }}" `
-Source "${{ env.FEED_URL }}"
shell: pwsh
- name: Add NuGet sources
if: runner.os != 'Windows'
run: |
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \
sources add \
-Source "${{ env.FEED_URL }}" \
-StorePasswordInClearText \
-Name GitHubPackages \
-UserName "${{ env.USERNAME }}" \
-Password "${{ secrets.GITHUB_TOKEN }}"
mono `${{ env.VCPKG_EXE }} fetch nuget | tail -n 1` \
setapikey "${{ secrets.GITHUB_TOKEN }}" \
-Source "${{ env.FEED_URL }}"
shell: bash
- name: Configure OCCT ${{ matrix.build_type }} (Unix)
if: runner.os != 'Windows'
run: |
mkdir build-${{ matrix.build_type }}
cd build-${{ matrix.build_type }}
cmake -G Ninja \
-DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DBUILD_USE_VCPKG=ON \
-DUSE_MMGR_TYPE=NATIVE \
-DUSE_FREETYPE=ON \
-DUSE_TK=OFF \
-DBUILD_USE_PCH=ON \
-DBUILD_INCLUDE_SYMLINK=ON \
-DBUILD_LIBRARY_TYPE="Static" \
-DINSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} \
-DUSE_DRACO=ON \
-DUSE_FFMPEG=ON \
-DUSE_FREEIMAGE=ON \
-DUSE_GLES2=OFF \
-DUSE_VTK=ON \
-DUSE_TBB=ON \
-DUSE_RAPIDJSON=ON \
-DUSE_OPENGL=ON \
-DBUILD_MODULE_Draw=OFF \
-DVCPKG_INSTALL_OPTIONS=--clean-buildtrees-after-build \
${{ runner.os != 'macOS' && '-DUSE_OPENVR=ON' || '' }} ..
shell: bash
- name: Configure OCCT ${{ matrix.build_type }} (Windows)
if: runner.os == 'Windows'
run: |
mkdir build-${{ matrix.build_type }}
cd build-${{ matrix.build_type }}
cmake -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake ^
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ^
-DBUILD_USE_VCPKG=ON ^
-DUSE_MMGR_TYPE=JEMALLOC ^
-DUSE_FREETYPE=ON ^
-DUSE_TK=OFF ^
-DBUILD_USE_PCH=ON ^
-DBUILD_INCLUDE_SYMLINK=ON ^
-DINSTALL_DIR=${{ github.workspace }}/install-${{ matrix.build_type }} ^
-DUSE_DRACO=ON ^
-DUSE_FFMPEG=OFF ^
-DUSE_FREEIMAGE=ON ^
-DUSE_GLES2=ON ^
-DUSE_OPENVR=ON ^
-DUSE_VTK=ON ^
-DUSE_TBB=ON ^
-DUSE_RAPIDJSON=ON ^
-DVCPKG_INSTALL_OPTIONS=--clean-buildtrees-after-build ^
-DUSE_OPENGL=ON ..
shell: cmd
- name: Build OCCT ${{ matrix.build_type }} (Unix)
if: runner.os != 'Windows'
run: |
cd build-${{ matrix.build_type }}
cmake --build . --target install --config ${{ matrix.build_type }}
shell: bash
- name: Build OCCT ${{ matrix.build_type }} (Windows)
if: runner.os == 'Windows'
run: |
cd build-${{ matrix.build_type }}
cmake --build . --target install --config ${{ matrix.build_type }}
shell: cmd

View File

@@ -1,97 +0,0 @@
# This workflow performs code analysis using both CodeQL and Microsoft C++ Code Analysis.
# It is triggered on pushes to the 'master' branch and publishes warnings into the security GitHub tab.
# The workflow includes two jobs: one for CodeQL analysis on Ubuntu and another for MSVC Code Analysis on Windows.
name: Code Analysis
on:
push:
branches:
- 'master'
permissions:
contents: read
security-events: write
packages: read
env:
# Path to the CMake build directory.
build: '${{ github.workspace }}/build'
config: 'Debug'
jobs:
codeql-analyze:
name: CodeQL Analyze (C/C++)
runs-on: ubuntu-latest
steps:
# Step: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4.1.7
# Step: Install necessary dependencies for building the project
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev
# Step: Initialize CodeQL for scanning
- name: Initialize CodeQL
uses: github/codeql-action/init@v3.26.5
with:
languages: c-cpp
build-mode: manual
# Step: Build the project using CMake and Make
- name: Build project
shell: bash
run: |
mkdir -p build
cd build
cmake -G "Unix Makefiles" \
-D CMAKE_C_COMPILER=gcc \
-D CMAKE_CXX_COMPILER=g++ \
-D USE_FREETYPE=OFF \
-D CMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
# Step: Perform CodeQL Analysis
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.26.5
with:
category: "/language:c-cpp"
msvc-analyze:
name: Microsoft C++ Code Analysis
runs-on: windows-latest
steps:
# Step: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4.1.7
# Step: Install necessary dependencies using Chocolatey
- name: Install dependencies
run: |
choco install cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y
choco install magicsplat-tcl-tk -y
# Step: Configure the project using CMake
- name: Configure CMake
run: |
mkdir build
cd build
cmake -D USE_FREETYPE=OFF -DCMAKE_BUILD_TYPE=${{ env.config }} ..
# Step: Run MSVC Code Analysis
- name: Run MSVC Code Analysis
uses: microsoft/msvc-code-analysis-action@v0.1.1
id: run-analysis
with:
cmakeBuildDirectory: ${{ env.build }}
buildConfiguration: ${{ env.config }}
ruleset: NativeRecommendedRules.ruleset
# Step: Upload SARIF file to GitHub Code Scanning Alerts
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v3.26.5
with:
sarif_file: ${{ steps.run-analysis.outputs.sarif }}

View File

@@ -0,0 +1,81 @@
# This workflow runs daily on the IR branch to configure OCCT with vcpkg packages.
# It only performs configuration without building or installing, using vcpkg for dependency management.
name: Daily IR Branch vcpkg Configure
on:
schedule:
# Run daily at 02:00 UTC
- cron: '0 2 * * *'
workflow_dispatch:
# Allow manual triggering
jobs:
configure-windows:
name: Configure OCCT on Windows with MSVC
runs-on: windows-2025
if: github.repository == 'Open-Cascade-SAS/OCCT'
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
with:
ref: IR
- name: Configure OCCT
uses: ./.github/actions/configure-occt
with:
platform: windows
compiler: msvc
cmake-build-type: Release
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify configuration output
run: |
echo "::notice::Successfully configured OCCT on Windows with vcpkg packages"
configure-macos:
name: Configure OCCT on macOS with Clang
runs-on: macos-15
if: github.ref == 'refs/heads/IR' && github.repository == 'Open-Cascade-SAS/OCCT'
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
with:
ref: IR
- name: Configure OCCT
uses: ./.github/actions/configure-occt
with:
platform: macos
compiler: clang
cmake-build-type: Release
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify configuration output
run: |
echo "::notice::Successfully configured OCCT on macOS with vcpkg packages"
configure-linux:
name: Configure OCCT on Ubuntu with Clang
runs-on: ubuntu-24.04
if: github.repository == 'Open-Cascade-SAS/OCCT'
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
with:
ref: IR
- name: Configure OCCT
uses: ./.github/actions/configure-occt
with:
platform: linux
compiler: clang
cmake-build-type: Release
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify configuration output
run: |
echo "::notice::Successfully configured OCCT on Linux with vcpkg packages"

297
.github/workflows/master-validation.yml vendored Normal file
View File

@@ -0,0 +1,297 @@
# Master validation workflow that combines multiple build configurations
# This workflow is triggered only on pushes to the master branch of the main repository
# It includes Windows (MSVC, MinGW), Ubuntu, vcpkg builds, and code analysis
name: Master Validation
on:
push:
branches:
- master
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
# Windows MSVC/Clang builds
windows-msvc:
if: github.repository == 'Open-Cascade-SAS/OCCT'
name: Windows MSVC/Clang validation
runs-on: windows-2025
strategy:
fail-fast: false
matrix:
config:
- {
name: "MSVC",
cc: "cl",
cxx: "cl",
generator: "Visual Studio 17 2022",
toolset: "host=x64",
c_flags: "/W4 /WX",
cxx_flags: "/W4 /WX"
}
- {
name: "Clang",
cc: "clang",
cxx: "clang++",
generator: "Ninja",
toolset: "",
c_flags: "-Werror -Wall -Wextra -Wno-unknown-warning-option -Wno-error=cast-function-type-mismatch",
cxx_flags: "-Werror -Wall -Wextra -Wno-unknown-warning-option -Wno-error=cast-function-type-mismatch"
}
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Setup Windows MSVC dependencies
uses: ./.github/actions/setup-windows-msvc-deps
- name: Build basic configuration
uses: ./.github/actions/cmake-build-basic
with:
generator: ${{ matrix.config.generator }}
cc: ${{ matrix.config.cc }}
cxx: ${{ matrix.config.cxx }}
build-type: "Release"
thirdparty-dir: ${{ github.workspace }}/3rdparty-vc14-64
compiler-flags: "${{ matrix.config.toolset != '' && format('-T {0}', matrix.config.toolset) || '' }} -D CMAKE_CXX_FLAGS=\"${{ matrix.config.cxx_flags }}\" -D CMAKE_C_FLAGS=\"${{ matrix.config.c_flags }}\""
- name: Build full shared configuration
uses: ./.github/actions/cmake-build-full
with:
generator: ${{ matrix.config.generator }}
cc: ${{ matrix.config.cc }}
cxx: ${{ matrix.config.cxx }}
build-type: "Debug"
library-type: "Shared"
opt-profile: "Production"
thirdparty-dir: ${{ github.workspace }}/3rdparty-vc14-64
compiler-flags: "${{ matrix.config.toolset != '' && format('-T {0}', matrix.config.toolset) || '' }} -D CMAKE_CXX_FLAGS=\"${{ matrix.config.cxx_flags }}\" -D CMAKE_C_FLAGS=\"${{ matrix.config.c_flags }}\" -D USE_FFMPEG=ON"
use-vtk: ${{ matrix.config.name == 'MSVC' && 'ON' || 'OFF' }}
use-tbb: "ON"
# Windows MinGW builds
windows-mingw:
if: github.repository == 'Open-Cascade-SAS/OCCT'
name: Windows MinGW validation
runs-on: windows-2025
strategy:
fail-fast: false
matrix:
config:
- {
name: "GCC",
cc: "x86_64-w64-mingw32-gcc",
cxx: "x86_64-w64-mingw32-g++",
package: "mingw-w64-x86_64-toolchain",
msystem: "MINGW64",
compiler_flags: "",
dependencies: "mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-rapidjson mingw-w64-x86_64-freetype mingw-w64-x86_64-draco mingw-w64-x86_64-freeimage mingw-w64-x86_64-tbb mingw-w64-x86_64-tk mingw-w64-x86_64-tcl mingw-w64-x86_64-openvr mingw-w64-x86_64-jemalloc mingw-w64-x86_64-mesa mingw-w64-x86_64-angleproject mingw-w64-x86_64-llvm-openmp mingw-w64-x86_64-winpthreads-git mingw-w64-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
}
- {
name: "Clang",
cc: "clang",
cxx: "clang++",
package: "mingw-w64-clang-x86_64-toolchain",
msystem: "CLANG64",
compiler_flags: "-D CMAKE_CXX_FLAGS=\"-Wall -Wextra\" -D CMAKE_C_FLAGS=\"-Wall -Wextra\"",
dependencies: "mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-ninja mingw-w64-clang-x86_64-rapidjson mingw-w64-clang-x86_64-freetype mingw-w64-clang-x86_64-draco mingw-w64-clang-x86_64-freeimage mingw-w64-clang-x86_64-tbb mingw-w64-clang-x86_64-tk mingw-w64-clang-x86_64-tcl mingw-w64-clang-x86_64-openvr mingw-w64-clang-x86_64-jemalloc mingw-w64-clang-x86_64-mesa mingw-w64-clang-x86_64-angleproject mingw-w64-clang-x86_64-llvm-openmp mingw-w64-clang-x86_64-winpthreads-git mingw-w64-clang-x86_64-libwinpthread-git mingw-w64-cross-mingwarm64-winpthreads"
}
build_type: [Debug, Release]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Setup MSYS2
uses: ./.github/actions/setup-msys2
with:
msystem: ${{ matrix.config.msystem }}
packages: ${{ matrix.config.package }}
dependencies: ${{ matrix.config.dependencies }}
- name: Build basic configuration
uses: ./.github/actions/cmake-build-basic
with:
generator: "Ninja"
cc: ${{ matrix.config.cc }}
cxx: ${{ matrix.config.cxx }}
build-type: ${{ matrix.build_type }}
shell-type: "msys2"
compiler-flags: ${{ matrix.config.compiler_flags }}
- name: Build full shared configuration
uses: ./.github/actions/cmake-build-full
with:
generator: "Ninja"
cc: ${{ matrix.config.cc }}
cxx: ${{ matrix.config.cxx }}
build-type: ${{ matrix.build_type }}
library-type: "Shared"
opt-profile: "Production"
shell-type: "msys2"
compiler-flags: ${{ matrix.config.compiler_flags }}
use-vtk: "OFF"
use-tbb: "OFF"
# Ubuntu builds
ubuntu:
if: github.repository == 'Open-Cascade-SAS/OCCT'
name: Ubuntu validation
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
config:
- {
name: "GCC",
cc: "gcc",
cxx: "g++",
compiler_flags: ""
}
- {
name: "Clang",
cc: "clang",
cxx: "clang++",
compiler_flags: "-D CMAKE_CXX_FLAGS=\"-Werror -Wall -Wextra\" -D CMAKE_C_FLAGS=\"-Werror -Wall -Wextra\""
}
build_type: [Debug, Release]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Setup Ubuntu dependencies
uses: ./.github/actions/setup-ubuntu-deps
- name: Build basic configuration
uses: ./.github/actions/cmake-build-basic
with:
generator: "Ninja"
cc: ${{ matrix.config.cc }}
cxx: ${{ matrix.config.cxx }}
build-type: ${{ matrix.build_type }}
compiler-flags: ${{ matrix.config.compiler_flags }}
- name: Build full shared configuration
uses: ./.github/actions/cmake-build-full
with:
generator: "Ninja"
cc: ${{ matrix.config.cc }}
cxx: ${{ matrix.config.cxx }}
build-type: ${{ matrix.build_type }}
library-type: "Shared"
opt-profile: "Production"
compiler-flags: ${{ matrix.config.compiler_flags }}
rapidjson-dir: ${{ github.workspace }}/rapidjson-858451e5b7d1c56cf8f6d58f88cf958351837e53
use-vtk: "ON"
use-tbb: "ON"
# vcpkg builds
vcpkg:
if: github.repository == 'Open-Cascade-SAS/OCCT'
name: vcpkg validation
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, ubuntu-22.04, windows-2022, windows-2025, macos-15, macos-14]
build_type: [Debug, Release]
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Build OCCT with vcpkg
uses: ./.github/actions/build-occt
with:
platform: ${{ runner.os == 'Windows' && 'windows' || runner.os == 'macOS' && 'macos' || 'linux' }}
compiler: ${{ runner.os == 'Windows' && 'msvc' || 'clang' }}
artifact-name: occt-${{ matrix.os }}-${{ matrix.build_type }}
cmake-build-type: ${{ matrix.build_type }}
github-token: ${{ secrets.GITHUB_TOKEN }}
# Code analysis
codeql-analyze:
if: github.repository == 'Open-Cascade-SAS/OCCT'
name: CodeQL Analyze (C/C++)
runs-on: ubuntu-24.04
permissions:
contents: read
security-events: write
packages: read
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y tcl-dev tk-dev cmake gcc g++ make libbtbb-dev libx11-dev libglu1-mesa-dev
- name: Initialize CodeQL
uses: github/codeql-action/init@v3.26.5
with:
languages: c-cpp
build-mode: manual
- name: Build project for analysis
uses: ./.github/actions/cmake-build-basic
with:
generator: "Unix Makefiles"
cc: "gcc"
cxx: "g++"
build-type: "Release"
compiler-flags: "-D USE_FREETYPE=OFF"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.26.5
with:
category: "/language:c-cpp"
msvc-analyze:
if: github.repository == 'Open-Cascade-SAS/OCCT'
name: Microsoft C++ Code Analysis
runs-on: windows-2025
permissions:
contents: read
security-events: write
packages: read
env:
build: '${{ github.workspace }}/build'
config: 'Debug'
steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
- name: Configure OCCT for analysis
uses: ./.github/actions/configure-occt
with:
platform: 'windows'
compiler: 'msvc'
build-use-pch: 'false'
cmake-build-type: ${{ env.config }}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run MSVC Code Analysis
uses: microsoft/msvc-code-analysis-action@v0.1.1
id: run-analysis
with:
cmakeBuildDirectory: ${{ env.build }}
buildConfiguration: ${{ env.config }}
ruleset: NativeRecommendedRules.ruleset
- name: Upload SARIF to GitHub
uses: github/codeql-action/upload-sarif@v3.26.5
with:
sarif_file: ${{ steps.run-analysis.outputs.sarif }}

15
.gitignore vendored
View File

@@ -56,3 +56,18 @@ win64
/build*
/install*
/tools/build*
# Coding agents instructions (keep .github/copilot-instructions.md)
/.CLAUDE.md
/.AGENT.md
/.GEMINI.md
/.COPILOT.md
/.CURSOR.md
/.CODEIUM.md
/.TABNINE.md
/.CHATGPT.md
/.BARD.md
/.PERPLEXITY.md
/.CONTINUE.md
/.AIDER.md
/.WINDSURF.md

View File

@@ -65,27 +65,21 @@ set (CMAKE_SUPPRESS_REGENERATION TRUE)
set (CMAKE_CONFIGURATION_TYPES Release Debug RelWithDebInfo CACHE INTERNAL "" FORCE)
# set using C++ standard
set (BUILD_CPP_STANDARD "C++11" CACHE STRING "Select using c++ standard.")
set_property(CACHE BUILD_CPP_STANDARD PROPERTY STRINGS "C++11" "C++14" "C++17" "C++20" "C++23")
set (BUILD_CPP_STANDARD "C++17" CACHE STRING "Select using c++ standard.")
set_property(CACHE BUILD_CPP_STANDARD PROPERTY STRINGS "C++17" "C++20" "C++23 C++26")
# Set desired C++ standard
if ("${BUILD_CPP_STANDARD}" STREQUAL "C++11")
set (CMAKE_CXX_STANDARD 11)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++14")
set (CMAKE_CXX_STANDARD 14)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++17")
if ("${BUILD_CPP_STANDARD}" STREQUAL "C++17")
set (CMAKE_CXX_STANDARD 17)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++20")
set (CMAKE_CXX_STANDARD 20)
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++23")
set (CMAKE_CXX_STANDARD 23)
else ()
message (FATAL_ERROR, "misprint in c++ standard name")
endif()
if (DEFINED BUILD_GTEST AND BUILD_GTEST AND CMAKE_CXX_STANDARD LESS 14)
set (CMAKE_CXX_STANDARD 14)
message (STATUS "Info: C++14 standard is required for GTest. Set to C++14.")
elseif ("${BUILD_CPP_STANDARD}" STREQUAL "C++26")
set (CMAKE_CXX_STANDARD 26)
else()
message (WARNING "C++ standard is not set or invalid. Set to C++17.")
set (CMAKE_CXX_STANDARD 17)
endif()
set (CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -490,10 +484,18 @@ OCCT_IS_PRODUCT_REQUIRED (CSF_EIGEN CAN_USE_EIGEN)
set (OCCT_3RDPARTY_CMAKE_LIST)
# define CSF variable
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf")
# Tcl (mandatory for Draw Harness)
if (USE_TCL)
message (STATUS "Info: TCL is used by OCCT")
OCCT_ADD_VCPKG_FEATURE ("tcl")
if (CAN_USE_TK AND USE_TK)
OCCT_ADD_VCPKG_FEATURE ("tcltk")
else()
OCCT_ADD_VCPKG_FEATURE ("tcl")
OCCT_UNSET_VCPKG_FEATURE ("tcltk")
endif()
list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/tcl")
else()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TCL")
@@ -504,7 +506,6 @@ endif()
# Tk (optional for Draw Harness)
if (CAN_USE_TK AND USE_TK)
message (STATUS "Info: TK is used by OCCT")
OCCT_ADD_VCPKG_FEATURE ("tk")
list (APPEND OCCT_3RDPARTY_CMAKE_LIST "adm/cmake/tk")
else()
if (NOT CAN_USE_TK)
@@ -512,7 +513,6 @@ else()
endif()
OCCT_CHECK_AND_UNSET_GROUP ("3RDPARTY_TK")
OCCT_CHECK_AND_UNSET ("INSTALL_TK")
OCCT_UNSET_VCPKG_FEATURE ("tk")
endif()
# Xlib
@@ -778,6 +778,11 @@ if (BUILD_USE_VCPKG)
project (OCCT)
endif()
if (APPLE)
# set Apple specific variables
occt_set_apple_csf_vars()
endif()
# copying clang-format file to the root of the project
file(COPY ${CMAKE_SOURCE_DIR}/.clang-format DESTINATION ${CMAKE_SOURCE_DIR})
@@ -785,9 +790,6 @@ file(COPY ${CMAKE_SOURCE_DIR}/.clang-format DESTINATION ${CMAKE_SOURCE_DIR})
OCCT_MAKE_OS_WITH_BITNESS()
OCCT_MAKE_COMPILER_SHORT_NAME()
# define CSF variable
OCCT_INCLUDE_CMAKE_FILE ("adm/cmake/occt_csf")
# do not define INSTALL_DIR_BIN for win.
# Leave library structure for win: <prefix>/win64/vc10/bin(d)
if (NOT DEFINED INSTALL_DIR_BIN)

View File

@@ -38,11 +38,7 @@ endmacro()
# vcpkg processing
if (BUILD_USE_VCPKG)
find_package (draco CONFIG REQUIRED)
set (3RDPARTY_DRACO_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}")
SEARCH_DRACO_LIB()
list (APPEND 3RDPARTY_INCLUDE_DIRS "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include/draco")
set(CSF_Draco draco::draco)
return()
endif()

View File

@@ -113,37 +113,8 @@ if (WIN32)
set (CSF_OpenGlLibs "opengl32.lib")
set (CSF_OpenGlesLibs "libEGL libGLESv2")
else()
if (APPLE)
set (CSF_objc "objc")
# frameworks
if (IOS)
find_library (Appkit_LIB NAMES UIKit)
set (CSF_Appkit ${Appkit_LIB})
else()
find_library (Appkit_LIB NAMES AppKit)
set (CSF_Appkit ${Appkit_LIB})
endif()
OCCT_CHECK_AND_UNSET (Appkit_LIB)
find_library (IOKit_LIB NAMES IOKit)
set (CSF_IOKit ${IOKit_LIB})
OCCT_CHECK_AND_UNSET (IOKit_LIB)
if (IOS)
find_library (OpenGlesLibs_LIB NAMES OpenGLES)
set (CSF_OpenGlesLibs ${OpenGlesLibs_LIB})
OCCT_CHECK_AND_UNSET (OpenGlesLibs_LIB)
elseif (USE_XLIB)
set (CSF_OpenGlLibs "GL")
set (CSF_XwLibs "X11")
else()
find_library (OpenGlLibs_LIB NAMES OpenGL)
set (CSF_OpenGlLibs ${OpenGlLibs_LIB})
OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
endif()
# Will be called later
elseif (EMSCRIPTEN)
set (CSF_ThreadLibs "pthread rt stdc++")
set (CSF_OpenGlesLibs "EGL GLESv2")
@@ -163,7 +134,59 @@ else()
set (CSF_OpenGlesLibs "EGL GLESv2")
set (CSF_dl "dl")
if (USE_FREETYPE)
set (CSF_fontconfig "fontconfig")
set (CSF_fontconfig "fontconfig expat")
endif()
endif()
endif()
# Updates APPLE variables
function(occt_set_apple_csf_vars)
set (CSF_objc "objc" PARENT_SCOPE)
# frameworks
if (IOS)
find_library (Appkit_LIB NAMES UIKit)
if (Appkit_LIB)
set (CSF_Appkit ${Appkit_LIB} PARENT_SCOPE)
else()
set (CSF_Appkit "UIKit" PARENT_SCOPE)
endif()
else()
find_library (Appkit_LIB NAMES AppKit)
if (Appkit_LIB)
set (CSF_Appkit ${Appkit_LIB} PARENT_SCOPE)
else()
set (CSF_Appkit "AppKit" PARENT_SCOPE)
endif()
endif()
OCCT_CHECK_AND_UNSET (Appkit_LIB)
find_library (IOKit_LIB NAMES IOKit)
if (IOKit_LIB)
set (CSF_IOKit ${IOKit_LIB} PARENT_SCOPE)
else()
set (CSF_IOKit "IOKit" PARENT_SCOPE)
endif()
OCCT_CHECK_AND_UNSET (IOKit_LIB)
if (IOS)
find_library (OpenGlesLibs_LIB NAMES OpenGLES)
if (OpenGlesLibs_LIB)
set (CSF_OpenGlesLibs ${OpenGlesLibs_LIB} PARENT_SCOPE)
else()
set (CSF_OpenGlesLibs "OpenGLES" PARENT_SCOPE)
endif()
OCCT_CHECK_AND_UNSET (OpenGlesLibs_LIB)
elseif (USE_XLIB)
set (CSF_OpenGlLibs "GL" PARENT_SCOPE)
set (CSF_XwLibs "X11" PARENT_SCOPE)
else()
find_library (OpenGlLibs_LIB NAMES OpenGL)
if (OpenGlLibs_LIB)
set (CSF_OpenGlLibs ${OpenGlLibs_LIB} PARENT_SCOPE)
else()
set (CSF_OpenGlLibs "OpenGL" PARENT_SCOPE)
endif()
OCCT_CHECK_AND_UNSET (OpenGlLibs_LIB)
endif()
endfunction()

View File

@@ -151,15 +151,27 @@ elseif (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR (CMAKE_CXX_COMPIL
# /GL (whole program optimization) is similar to -flto (Link Time Optimization) in GCC/Clang.
# /GF (eliminate duplicate strings) doesn't have a direct equivalent in GCC/Clang, but the compilers do string pooling automatically.
# /Gy (enable function-level linking) is similar to -ffunction-sections in GCC/Clang.
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer -flto -ffunction-sections")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -fomit-frame-pointer -flto -ffunction-sections")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -fomit-frame-pointer")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -fomit-frame-pointer")
# Apply LTO optimization on all platforms
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -flto")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -flto")
# Apply function sections only on non-macOS platforms
if (NOT APPLE)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffunction-sections")
endif()
# Link-Time Code Generation(LTCG) is requared for Whole Program Optimisation(GL)
# Link-Time Code Generation (LTCG) is required for Whole Program Optimization
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -flto")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -flto")
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -flto")
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto")
if (NOT WIN32)
# Add garbage collection sections only on Linux (not on macOS or Windows)
if (NOT WIN32 AND NOT APPLE)
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")

View File

@@ -72,24 +72,9 @@ endmacro()
macro (OCCT_MAKE_COMPILER_SHORT_NAME)
if (MSVC)
if (MSVC_VERSION LESS 1914)
message (AUTHOR_WARNING "Microsoft Visual C++ 19.14 (VS 2017 15.7) or newer is required for C++17 support")
message (FATAL_ERROR "Microsoft Visual C++ 19.14 (VS 2017 15.7) or newer is required for C++17 support")
endif()
if ((MSVC_VERSION EQUAL 1300) OR (MSVC_VERSION EQUAL 1310))
set (COMPILER vc7)
elseif (MSVC_VERSION EQUAL 1400)
set (COMPILER vc8)
elseif (MSVC_VERSION EQUAL 1500)
set (COMPILER vc9)
elseif (MSVC_VERSION EQUAL 1600)
set (COMPILER vc10)
elseif (MSVC_VERSION EQUAL 1700)
set (COMPILER vc11)
elseif (MSVC_VERSION EQUAL 1800)
set (COMPILER vc12)
elseif (MSVC_VERSION EQUAL 1900)
set (COMPILER vc14)
elseif ((MSVC_VERSION GREATER 1900) AND (MSVC_VERSION LESS 2000))
if ((MSVC_VERSION GREATER 1900) AND (MSVC_VERSION LESS 2000))
# Since Visual Studio 15 (2017), its version diverged from version of
# compiler which is 14.1; as that compiler uses the same run-time as 14.0,
# we keep its id as "vc14" to be compatible
@@ -99,28 +84,28 @@ macro (OCCT_MAKE_COMPILER_SHORT_NAME)
endif()
elseif (DEFINED CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
message (AUTHOR_WARNING "GCC version 8.0 or newer is required for C++17 support")
message (FATAL_ERROR "GCC version 8.0 or newer is required for C++17 support")
endif()
set (COMPILER gcc)
elseif (DEFINED CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8.0)
message (AUTHOR_WARNING "GCC version 8.0 or newer is required for C++17 support")
message (FATAL_ERROR "GCC version 8.0 or newer is required for C++17 support")
endif()
set (COMPILER gxx)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
if(APPLE)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 11.0.0)
message (AUTHOR_WARNING "Apple Clang version 11.0.0 or newer is required for C++17 support")
message (FATAL_ERROR "Apple Clang version 11.0.0 or newer is required for C++17 support")
endif()
else()
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)
message (AUTHOR_WARNING "Clang version 7.0 or newer is required for C++17 support")
message (FATAL_ERROR "Clang version 7.0 or newer is required for C++17 support")
endif()
endif()
set (COMPILER clang)
elseif (CMAKE_CXX_COMPILER_ID MATCHES "[Ii][Nn][Tt][Ee][Ll]")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 17.1.1)
message (AUTHOR_WARNING "Intel C++ Compiler version 17.1.1 or newer is required for C++17 support")
message (FATAL_ERROR "Intel C++ Compiler version 17.1.1 or newer is required for C++17 support")
endif()
set (COMPILER icc)
else()
@@ -268,7 +253,7 @@ function (EXTRACT_PACKAGE_FILES RELATIVE_PATH OCCT_PACKAGE RESULT_FILES RESULT_I
set (OCCT_PACKAGE_FILES "${OCCT_${OCCT_PACKAGE}_FILES}")
# collect and search for the files in the package directory or patched one
# FILE contains inly filename that must to be inside package or patched directory
# FILE only contains filename that must to be inside package or patched directory
set (FILE_PATH_LIST)
foreach (OCCT_FILE ${OCCT_PACKAGE_FILES})
@@ -381,6 +366,11 @@ function (COLLECT_AND_INSTALL_OCCT_HEADER_FILES THE_ROOT_TARGET_OCCT_DIR THE_OCC
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|g|p|lxx|hxx|pxx|hpp|gxx)$")
list (APPEND OCCT_HEADER_FILES_COMPLETE ${HEADER_FILES_FILTERING})
endforeach()
# parse root of the toolkit file
EXTRACT_PACKAGE_FILES (${THE_RELATIVE_PATH} ${OCCT_TOOLKIT} ALL_FILES _)
set (HEADER_FILES_FILTERING ${ALL_FILES})
list (FILTER HEADER_FILES_FILTERING INCLUDE REGEX ".+[.](h|g|p|lxx|hxx|pxx|hpp|gxx)$")
list (APPEND OCCT_HEADER_FILES_COMPLETE ${HEADER_FILES_FILTERING})
endforeach()
# Check that copying is done and match the include installation type.
@@ -438,10 +428,12 @@ function(ADD_PRECOMPILED_HEADER INPUT_TARGET PRECOMPILED_HEADER THE_IS_PRIVATE)
if (NOT BUILD_USE_PCH)
return()
endif()
# Angular bracket syntax is achieved using $<ANGLE-R> for closing bracket
if (${THE_IS_PRIVATE})
target_precompile_headers(${INPUT_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${PRECOMPILED_HEADER}>")
target_precompile_headers(${INPUT_TARGET} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:<${PRECOMPILED_HEADER}$<ANGLE-R>>")
else()
target_precompile_headers(${INPUT_TARGET} PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${PRECOMPILED_HEADER}>")
target_precompile_headers(${INPUT_TARGET} PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:<${PRECOMPILED_HEADER}$<ANGLE-R>>")
endif()
endfunction()
@@ -836,12 +828,12 @@ function (PROCESS_CSF_LIBRARIES CURRENT_CSF LIST_NAME TARGET_NAME)
foreach (RELEASE_DIR ${FOUND_RELEASE_DIRS})
get_filename_component(RELEASE_DIR_ABS "${RELEASE_DIR}" ABSOLUTE)
target_link_directories(${TARGET_NAME} PUBLIC "$<$<CONFIG:RELEASE>:${RELEASE_DIR_ABS}>;$<$<CONFIG:RELWITHDEBINFO>:${RELEASE_DIR_ABS}>")
target_link_directories(${TARGET_NAME} PRIVATE "$<$<CONFIG:RELEASE>:${RELEASE_DIR_ABS}>;$<$<CONFIG:RELWITHDEBINFO>:${RELEASE_DIR_ABS}>")
endforeach()
foreach (DEBUG_DIR ${FOUND_DEBUG_DIRS})
get_filename_component(DEBUG_DIR_ABS "${DEBUG_DIR}" ABSOLUTE)
target_link_directories(${TARGET_NAME} PUBLIC "$<$<CONFIG:DEBUG>:${DEBUG_DIR_ABS}>")
target_link_directories(${TARGET_NAME} PRIVATE "$<$<CONFIG:DEBUG>:${DEBUG_DIR_ABS}>")
endforeach()
endfunction()
macro(OCCT_ADD_VCPKG_FEATURE THE_FEATURE)

View File

@@ -281,14 +281,14 @@ if(IS_VTK_9XX)
string (REGEX REPLACE "vtk" "VTK::" USED_TOOLKITS_BY_CURRENT_PROJECT "${USED_TOOLKITS_BY_CURRENT_PROJECT}")
endif()
target_link_libraries (${PROJECT_NAME} ${USED_TOOLKITS_BY_CURRENT_PROJECT} ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
target_link_libraries (${PROJECT_NAME} PUBLIC ${USED_TOOLKITS_BY_CURRENT_PROJECT} PRIVATE ${USED_EXTERNAL_LIBS_BY_CURRENT_PROJECT})
if (USE_QT)
foreach (PROJECT_LIBRARY_DEBUG ${PROJECT_LIBRARIES_DEBUG})
target_link_libraries (${PROJECT_NAME} debug ${PROJECT_LIBRARY_DEBUG})
target_link_libraries (${PROJECT_NAME} PRIVATE debug ${PROJECT_LIBRARY_DEBUG})
endforeach()
foreach (PROJECT_LIBRARY_RELEASE ${PROJECT_LIBRARIES_RELEASE})
target_link_libraries (${PROJECT_NAME} optimized ${PROJECT_LIBRARY_RELEASE})
target_link_libraries (${PROJECT_NAME} PRIVATE optimized ${PROJECT_LIBRARY_RELEASE})
endforeach()
endif()

View File

@@ -71,7 +71,12 @@ if (WIN32)
# Get installed configuration of tbb
get_target_property (TARGET_TBB_IMPORT_CONFS TBB::tbb IMPORTED_CONFIGURATIONS)
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
# Prioritize RELEASE configuration if available
if (";${TARGET_TBB_IMPORT_CONFS};" MATCHES ";RELEASE;")
set (CHOSEN_IMPORT_CONF "RELEASE")
else()
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
endif()
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)
@@ -204,7 +209,12 @@ else ()
# Get installed configuration of tbb
get_target_property (TARGET_TBB_IMPORT_CONFS TBB::tbb IMPORTED_CONFIGURATIONS)
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
# Prioritize RELEASE configuration if available
if (";${TARGET_TBB_IMPORT_CONFS};" MATCHES ";RELEASE;")
set (CHOSEN_IMPORT_CONF "RELEASE")
else()
list (GET TARGET_TBB_IMPORT_CONFS 0 CHOSEN_IMPORT_CONF)
endif()
separate_arguments (CSF_TBB)
foreach (LIB IN LISTS CSF_TBB)

View File

@@ -17,6 +17,7 @@ endif()
if (BUILD_USE_VCPKG)
set (3RDPARTY_TCL_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" CACHE PATH "The directory containing tcl" FORCE)
set (3RDPARTY_TCL_INCLUDE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" CACHE FILEPATH "The directory containing headers of tcl" FORCE)
set (3RDPARTY_TCL_LIBRARY_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" CACHE FILEPATH "The directory containing tcl library" FORCE)
endif()
# tcl library file (with absolute path)
@@ -182,7 +183,7 @@ endif()
if (3RDPARTY_TCL_LIBRARY AND EXISTS "${3RDPARTY_TCL_LIBRARY}")
list (APPEND 3RDPARTY_LIBRARY_DIRS "${3RDPARTY_TCL_LIBRARY_DIR}")
else()
elseif(NOT BUILD_USE_VCPKG)
list (APPEND 3RDPARTY_NO_LIBS 3RDPARTY_TCL_LIBRARY_DIR)
endif()

View File

@@ -18,11 +18,11 @@ if (NOT DEFINED 3RDPARTY_TK_INCLUDE_DIR)
set (3RDPARTY_TK_INCLUDE_DIR "" CACHE FILEPATH "The directory containing headers of tk")
endif()
# if (BUILD_USE_VCPKG)
# set (3RDPARTY_TK_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" CACHE PATH "The directory containing tk" FORCE)
# set (3RDPARTY_TCLTK_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" CACHE PATH "The directory containing tcltk" FORCE)
# set (3RDPARTY_TK_INCLUDE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" CACHE FILEPATH "The directory containing headers of tk" FORCE)
# endif()
if (BUILD_USE_VCPKG)
set (3RDPARTY_TK_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" CACHE PATH "The directory containing tk" FORCE)
set (3RDPARTY_TCLTK_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" CACHE PATH "The directory containing tcltk" FORCE)
set (3RDPARTY_TK_INCLUDE_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" CACHE FILEPATH "The directory containing headers of tk" FORCE)
endif()
if (BUILD_SHARED_LIBS)
# tk library file (with absolute path)

View File

@@ -19,4 +19,4 @@
set (OCC_VERSION_MAJOR 8 )
set (OCC_VERSION_MINOR 0 )
set (OCC_VERSION_MAINTENANCE 0 )
set (OCC_VERSION_DEVELOPMENT "dev" )
set (OCC_VERSION_DEVELOPMENT "rc1" )

View File

@@ -166,10 +166,8 @@ if not "%CSF_OCCTBinPath%" == "" (
set "PATH=%CSF_OCCTBinPath%;%PATH%"
)
if not ["%TK_DIR%"] == ["%TCL_DIR%"] (
if not ["%TK_DIR%"] == [""] set "TK_LIBRARY=%TK_DIR%/../lib/tk%TK_VERSION_WITH_DOT%"
if not ["%TCL_DIR%"] == [""] set "TCL_LIBRARY=%TCL_DIR%/../lib/tcl%TCL_VERSION_WITH_DOT%"
)
if not ["%TK_DIR%"] == [""] set "TK_LIBRARY=%TK_DIR%/../lib/tk%TK_VERSION_WITH_DOT%"
if not ["%TCL_DIR%"] == [""] set "TCL_LIBRARY=%TCL_DIR%/../lib/tcl%TCL_VERSION_WITH_DOT%"
rem ----- Set envoronment variables used by OCCT -----
set CSF_LANGUAGE=us

View File

@@ -1,25 +0,0 @@
diff --git a/configure b/configure
index 89af70d..405680e 100755
--- a/configure
+++ b/configure
@@ -5480,15 +5480,17 @@ case $target_os in
;;
win32|win64)
disable symver
- if enabled shared; then
+# if enabled shared; then
# Link to the import library instead of the normal static library
# for shared libs.
LD_LIB='%.lib'
# Cannot build both shared and static libs with MSVC or icl.
- disable static
- fi
+# disable static
+# fi
enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
shlibdir_default="$bindir_default"
+ LIBPREF=""
+ LIBSUF=".lib"
SLIBPREF=""
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'

View File

@@ -1,13 +0,0 @@
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index fe424b6..2df70df 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -60,6 +60,8 @@
#include <sys/resource.h>
#endif
#ifdef _WIN32
+#define _WIN32_WINNT 0x0502
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif

View File

@@ -1,40 +0,0 @@
diff --git a/configure b/configure
index 405680e..cc5bf29 100755
--- a/configure
+++ b/configure
@@ -4111,6 +4111,9 @@ for opt do
--libfuzzer=*)
libfuzzer_path="$optval"
;;
+ --debug)
+ enable debug_configure
+ ;;
*)
optname="${opt%%=*}"
optname="${optname#--}"
@@ -6316,7 +6319,11 @@ fi
enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion ||
check_lib zlib zlib.h zlibVersion -lz; }
-enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
+if enabled debug_configure; then
+ enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2d
+else
+ enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
+fi
enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma
# On some systems dynamic loading requires no extra linker flags
@@ -6434,7 +6441,11 @@ enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8
enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
-enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
+if enabled debug_configure; then
+ enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
+else
+ enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
+fi
enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init
enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init

View File

@@ -1,49 +0,0 @@
diff --git a/configure b/configure
index cc5bf29..ee26559 100755
--- a/configure
+++ b/configure
@@ -6406,7 +6406,8 @@ if enabled libmfx; then
fi
enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load
-enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs
+enabled libmp3lame && { check_lib libmp3lame lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs ||
+ require libmp3lame lame/lame.h lame_set_VBR_quality -llibmp3lame-static -llibmpghip-static $libm_extralibs; }
enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine ||
require libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine -lmysofa $zlib_extralibs; }
enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei ||
@@ -6446,7 +6447,7 @@ if enabled debug_configure; then
else
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
fi
-enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
+enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr -lm
enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init
enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
@@ -6527,6 +6528,8 @@ enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal"
enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel ||
check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
+ check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL -lAdvapi32 -lOle32 -lCfgmgr32||
+ check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL -pthread -ldl ||
die "ERROR: opencl not found"; } &&
{ test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
test_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
@@ -6550,6 +6553,7 @@ enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OP
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
+ check_lib openssl openssl/ssl.h OPENSSL_init_ssl -llibssl -llibcrypto -lws2_32 -lgdi32 -lcrypt32 -lAdvapi32 -lUser32||
die "ERROR: openssl not found"; }
enabled pocketsphinx && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init
enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create &&
@@ -6811,7 +6815,7 @@ enabled amf &&
if enabled libc_iconv; then
check_func_headers iconv.h iconv
elif enabled iconv; then
- check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv
+ check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv || check_lib iconv iconv.h iconv -liconv -llibcharset
fi
enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"

View File

@@ -1,15 +0,0 @@
diff --git a/configure b/configure
index ee26559..f2c83b7 100755
--- a/configure
+++ b/configure
@@ -4496,6 +4496,10 @@ msvc_common_flags(){
-march=*) ;;
-lz) echo zlib.lib ;;
-lx264) echo libx264.lib ;;
+ -lx265) echo libx265.lib ;;
+ -lmp3lame) echo libmp3lame.lib ;;
+ -liconv) echo iconv.lib ;;
+ -lm) ;;
-lstdc++) ;;
-l*) echo ${flag#-l}.lib ;;
-LARGEADDRESSAWARE) echo $flag ;;

View File

@@ -1,13 +0,0 @@
diff --git a/configure b/configure
index f2c83b7..5e42b12 100755
--- a/configure
+++ b/configure
@@ -6379,7 +6379,7 @@ enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.
enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
- { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
+ { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac -lm -lstdc++ &&
warn "using libfdk without pkg-config"; } }
flite_extralibs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs

View File

@@ -1,13 +0,0 @@
diff --git a/configure b/configure
index 5e42b12..d8f059f 100755
--- a/configure
+++ b/configure
@@ -6497,7 +6497,7 @@ enabled libwebp && {
enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode ||
- { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" &&
+ { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs -ldl" &&
warn "using libx264 without pkg-config"; } } &&
require_cpp_condition libx264 x264.h "X264_BUILD >= 118" &&
check_cpp_condition libx262 x264.h "X264_MPEG2"

View File

@@ -1,16 +0,0 @@
diff --git a/configure b/configure
index d8f059f..f3688ad 100755
--- a/configure
+++ b/configure
@@ -6501,7 +6501,10 @@ enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x
warn "using libx264 without pkg-config"; } } &&
require_cpp_condition libx264 x264.h "X264_BUILD >= 118" &&
check_cpp_condition libx262 x264.h "X264_MPEG2"
-enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
+enabled libx265 && { check_pkg_config libx265 x265 x265.h x265_api_get ||
+ { { check_lib libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++ -lgcc_s -lgcc -lrt -lnuma" ||
+ require libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++"; } &&
+ warn "using libx265 without pkg-config"; } } &&
require_cpp_condition libx265 x265.h "X265_BUILD >= 70"
enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get

View File

@@ -1,12 +0,0 @@
diff --git a/configure b/configure
index f3688ad..26e512e 100755
--- a/configure
+++ b/configure
@@ -6556,6 +6556,7 @@ enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoR
enabled omx && require_headers OMX_Core.h
enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
check_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
+ check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto $pthreads_extralibs -ldl ||
check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto ||
check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||

View File

@@ -1,16 +0,0 @@
diff --git a/libavcodec/mf_utils.c b/libavcodec/mf_utils.c
index eeabd0c..ea3a03b 100644
--- a/libavcodec/mf_utils.c
+++ b/libavcodec/mf_utils.c
@@ -22,6 +22,11 @@
#define _WIN32_WINNT 0x0602
#endif
+#if !defined(WINVER) || WINVER < 0x0602
+#undef WINVER
+#define WINVER 0x0602
+#endif
+
#include "mf_utils.h"
#include "libavutil/pixdesc.h"

View File

@@ -1,23 +0,0 @@
diff --git a/configure b/configure
index 26e512e..c0377b6 100755
--- a/configure
+++ b/configure
@@ -3674,6 +3674,18 @@ vpp_qsv_filter_select="qsvvpp"
xfade_opencl_filter_deps="opencl"
yadif_cuda_filter_deps="ffnvcodec"
yadif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
+ametadata_filter_deps="avformat"
+metadata_filter_deps="avformat"
+headphone_filter_deps="avcodec"
+headphone_filter_select="fft"
+showspatial_filter_deps="avcodec"
+showspatial_filter_select="fft"
+superequalizer_filter_deps="avcodec"
+superequalizer_filter_select="rdft"
+surround_filter_deps="avcodec"
+surround_filter_select="rdft"
+sinc_filter_deps="avcodec"
+sinc_filter_select="rdft"
# examples
avio_list_dir_deps="avformat avutil"

View File

@@ -1,13 +0,0 @@
diff --git a/configure b/configure
index c0377b6..62753ef 100755
--- a/configure
+++ b/configure
@@ -6526,7 +6526,7 @@ enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h z
enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_decoder_new &&
{ test_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" ||
enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; }
-enabled libxml2 && require_pkg_config libxml2 libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion
+enabled libxml2 && require_pkg_config libxml2 libxml-2.0 libxml/xmlversion.h xmlCheckVersion
enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init ||
check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init ||
check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedx509 -lmbedcrypto ||

View File

@@ -1,30 +0,0 @@
diff --git a/compat/cuda/ptx2c.sh b/compat/cuda/ptx2c.sh
index 48452379c2..1c486dc30e 100755
--- a/compat/cuda/ptx2c.sh
+++ b/compat/cuda/ptx2c.sh
@@ -26,9 +26,10 @@ OUT="$1"
IN="$2"
NAME="$(basename "$IN" | sed 's/\..*//')"
-printf "const char %s_ptx[] = \\" "$NAME" > "$OUT"
+printf "const char %s_ptx[] = {\\" "$NAME" > "$OUT"
echo >> "$OUT"
-sed -e "$(printf 's/\r//g')" -e 's/["\\]/\\&/g' -e "$(printf 's/^/\t"/')" -e 's/$/\\n"/' < "$IN" >> "$OUT"
-echo ";" >> "$OUT"
+xxd -i < "$IN" >> "$OUT"
+echo " ,0x00" >> "$OUT"
+echo "};" >> "$OUT"
exit 0
diff --git a/configure b/configure
index 6190d06b0b..48fb73738e 100755
--- a/configure
+++ b/configure
@@ -1046,6 +1046,7 @@ test_nvcc(){
tmpo_=$TMPO
[ -x "$(command -v cygpath)" ] && tmpcu_=$(cygpath -m $tmpcu_) && tmpo_=$(cygpath -m $tmpo_)
test_cmd $nvcc $nvccflags "$@" $NVCC_C $(nvcc_o $tmpo_) $tmpcu_
+ test_cmd xxd
}
check_nvcc() {

View File

@@ -1,13 +0,0 @@
diff --git a/libavcodec/libaomdec.c b/libavcodec/libaomdec.c
index 1fc0a00..06b2ff0 100644
--- a/libavcodec/libaomdec.c
+++ b/libavcodec/libaomdec.c
@@ -224,7 +224,7 @@ static av_cold int aom_free(AVCodecContext *avctx)
static av_cold int av1_init(AVCodecContext *avctx)
{
- return aom_init(avctx, &aom_codec_av1_dx_algo);
+ return aom_init(avctx, aom_codec_av1_dx());
}
AVCodec ff_libaom_av1_decoder = {

View File

@@ -1,33 +0,0 @@
diff --git a/configure b/configure
index 62753ef..018764e 100755
--- a/configure
+++ b/configure
@@ -6508,11 +6508,8 @@ enabled libvpx && {
enabled libwebp && {
enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
-enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode ||
- { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs -ldl" &&
- warn "using libx264 without pkg-config"; } } &&
- require_cpp_condition libx264 x264.h "X264_BUILD >= 118" &&
- check_cpp_condition libx262 x264.h "X264_MPEG2"
+enabled libx264 && check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
+ require_cpp_condition libx264 x264.h "X264_BUILD >= 158"
enabled libx265 && { check_pkg_config libx265 x265 x265.h x265_api_get ||
{ { check_lib libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++ -lgcc_s -lgcc -lrt -lnuma" ||
require libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++"; } &&
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 4ddc497..0152d30 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -32,10 +32,6 @@
#include "packet_internal.h"
#include "atsc_a53.h"
-#if defined(_MSC_VER)
-#define X264_API_IMPORTS 1
-#endif
-
#include <x264.h>
#include <float.h>
#include <math.h>

View File

@@ -1,28 +0,0 @@
diff --git a/libswscale/aarch64/yuv2rgb_neon.S b/libswscale/aarch64/yuv2rgb_neon.S
index f4b220f..af677af 100644
--- a/libswscale/aarch64/yuv2rgb_neon.S
+++ b/libswscale/aarch64/yuv2rgb_neon.S
@@ -169,19 +169,19 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
sqdmulh v26.8H, v26.8H, v0.8H // ((Y1*(1<<3) - y_offset) * y_coeff) >> 15
sqdmulh v27.8H, v27.8H, v0.8H // ((Y2*(1<<3) - y_offset) * y_coeff) >> 15
-.ifc \ofmt,argb // 1 2 3 0
+.ifc \ofmt,argb
compute_rgba v5.8B,v6.8B,v7.8B,v4.8B, v17.8B,v18.8B,v19.8B,v16.8B
.endif
-.ifc \ofmt,rgba // 0 1 2 3
+.ifc \ofmt,rgba
compute_rgba v4.8B,v5.8B,v6.8B,v7.8B, v16.8B,v17.8B,v18.8B,v19.8B
.endif
-.ifc \ofmt,abgr // 3 2 1 0
+.ifc \ofmt,abgr
compute_rgba v7.8B,v6.8B,v5.8B,v4.8B, v19.8B,v18.8B,v17.8B,v16.8B
.endif
-.ifc \ofmt,bgra // 2 1 0 3
+.ifc \ofmt,bgra
compute_rgba v6.8B,v5.8B,v4.8B,v7.8B, v18.8B,v17.8B,v16.8B,v19.8B
.endif

View File

@@ -1,43 +0,0 @@
From c534d9f72a89542ed639071b1ae15893aadf1f18 Mon Sep 17 00:00:00 2001
From: rcombs <rcombs@rcombs.me>
Date: Sat, 16 Apr 2022 03:41:29 -0500
Subject: [PATCH] lavc/h264_ps: always include the stop bit in [s|p]ps->data
The VideoToolbox hwaccel needs the entire NAL (including the stop bit),
but ff_h2645_packet_split may remove it. Detect this case by looking for
bit counts divisible by 8 and insert a stop-bit-only 0x80 byte.
Signed-off-by: rcombs <rcombs@rcombs.me>
---
libavcodec/h264_ps.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index 051f06692c..e16da68dec 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -351,6 +351,10 @@ int ff_h264_decode_seq_parameter_set(GetBitContext *gb, AVCodecContext *avctx,
}
memcpy(sps->data, gb->buffer, sps->data_size);
+ // Re-add the removed stop bit (may be used by hwaccels).
+ if (!(gb->size_in_bits & 7) && sps->data_size < sizeof(sps->data))
+ sps->data[sps->data_size++] = 0x80;
+
profile_idc = get_bits(gb, 8);
constraint_set_flags |= get_bits1(gb) << 0; // constraint_set0_flag
constraint_set_flags |= get_bits1(gb) << 1; // constraint_set1_flag
@@ -775,6 +779,10 @@ int ff_h264_decode_picture_parameter_set(GetBitContext *gb, AVCodecContext *avct
}
memcpy(pps->data, gb->buffer, pps->data_size);
+ // Re-add the removed stop bit (may be used by hwaccels).
+ if (!(bit_length & 7) && pps->data_size < sizeof(pps->data))
+ pps->data[pps->data_size++] = 0x80;
+
pps->sps_id = get_ue_golomb_31(gb);
if ((unsigned)pps->sps_id >= MAX_SPS_COUNT ||
!ps->sps_list[pps->sps_id]) {
--
2.20.1

View File

@@ -1,22 +0,0 @@
Subject: [PATCH] fix d3d11
---
Index: qsv.c
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -383,7 +383,11 @@
int ff_qsv_init_internal_session(AVCodecContext *avctx, QSVSession *qs,
const char *load_plugins, int gpu_copy)
{
+#if CONFIG_D3D11VA
+ mfxIMPL impl = MFX_IMPL_AUTO_ANY | MFX_IMPL_VIA_D3D11;
+#else
mfxIMPL impl = MFX_IMPL_AUTO_ANY;
+#endif
mfxVersion ver = { { QSV_VERSION_MINOR, QSV_VERSION_MAJOR } };
mfxInitParam init_par = { MFX_IMPL_AUTO_ANY };

View File

@@ -1,165 +0,0 @@
# Distributed under the OSI-approved BSD 3-Clause License.
#
#.rst:
# FindFFMPEG
# --------
#
# Find the FFPMEG libraries
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# The following variables will be defined:
#
# ``FFMPEG_FOUND``
# True if FFMPEG found on the local system
#
# ``FFMPEG_INCLUDE_DIRS``
# Location of FFMPEG header files
#
# ``FFMPEG_LIBRARY_DIRS``
# Location of FFMPEG libraries
#
# ``FFMPEG_LIBRARIES``
# List of the FFMPEG libraries found
#
#
include(FindPackageHandleStandardArgs)
include(SelectLibraryConfigurations)
include(CMakeFindDependencyMacro)
if(NOT FFMPEG_FOUND)
# Compute the installation path relative to this file.
get_filename_component(SEARCH_PATH "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(SEARCH_PATH "${SEARCH_PATH}" PATH)
get_filename_component(SEARCH_PATH "${SEARCH_PATH}" PATH)
if(SEARCH_PATH STREQUAL "/")
set(SEARCH_PATH "")
endif()
set(FFMPEG_VERSION "@FFMPEG_VERSION@")
function(append_dependencies out)
cmake_parse_arguments(PARSE_ARGV 1 "arg" "DEBUG" "NAMES" "")
if(${arg_DEBUG})
set(config DEBUG)
set(path "${CURRENT_INSTALLED_DIR}/debug/lib/")
else()
set(config RELEASE)
set(path "${CURRENT_INSTALLED_DIR}/lib/")
endif()
foreach(lib_name ${arg_NAMES})
if("${lib_name}" STREQUAL "-pthread")
list(APPEND ${out} "-pthread")
elseif("${lib_name}" STREQUAL "-pthreads")
list(APPEND ${out} "-pthreads")
elseif("${lib_name}" STREQUAL "gcc")
list(APPEND ${out} "-lgcc")
elseif("${lib_name}" STREQUAL "gcc_s")
list(APPEND ${out} "-lgcc_s")
elseif("${lib_name}" STREQUAL "stdc++")
list(APPEND ${out} "-lstdc++")
else()
# first look in ${path} specifically to ensure we find the right release/debug variant
find_library(FFMPEG_DEPENDENCY_${lib_name}_${config} NAMES "${lib_name}" PATHS "${path}" NO_DEFAULT_PATH)
# if not found there, must be a system dependency, so look elsewhere
find_library(FFMPEG_DEPENDENCY_${lib_name}_${config} NAMES "${lib_name}" REQUIRED)
list(APPEND ${out} "${FFMPEG_DEPENDENCY_${lib_name}_${config}}")
endif()
endforeach()
set("${out}" "${${out}}" PARENT_SCOPE)
endfunction()
macro(FFMPEG_FIND varname shortname headername)
if(NOT FFMPEG_${varname}_INCLUDE_DIRS)
find_path(FFMPEG_${varname}_INCLUDE_DIRS NAMES lib${shortname}/${headername} ${headername} PATHS ${SEARCH_PATH}/include NO_DEFAULT_PATH)
endif()
if(NOT FFMPEG_${varname}_LIBRARY)
find_library(FFMPEG_${varname}_LIBRARY_RELEASE NAMES ${shortname} PATHS ${SEARCH_PATH}/lib/ NO_DEFAULT_PATH)
find_library(FFMPEG_${varname}_LIBRARY_DEBUG NAMES ${shortname}d ${shortname} PATHS ${SEARCH_PATH}/debug/lib/ NO_DEFAULT_PATH)
get_filename_component(FFMPEG_${varname}_LIBRARY_RELEASE_DIR ${FFMPEG_${varname}_LIBRARY_RELEASE} DIRECTORY)
get_filename_component(FFMPEG_${varname}_LIBRARY_DEBUG_DIR ${FFMPEG_${varname}_LIBRARY_DEBUG} DIRECTORY)
select_library_configurations(FFMPEG_${varname})
set(FFMPEG_${varname}_LIBRARY ${FFMPEG_${varname}_LIBRARY} CACHE STRING "")
endif()
if (FFMPEG_${varname}_LIBRARY AND FFMPEG_${varname}_INCLUDE_DIRS)
set(FFMPEG_${varname}_FOUND TRUE BOOL)
list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_${varname}_INCLUDE_DIRS})
list(APPEND FFMPEG_LIBRARIES ${FFMPEG_${varname}_LIBRARY})
list(APPEND FFMPEG_LIBRARY_DIRS ${FFMPEG_${varname}_LIBRARY_RELEASE_DIR} ${FFMPEG_${varname}_LIBRARY_DEBUG_DIR})
endif()
endmacro(FFMPEG_FIND)
if(@ENABLE_AVDEVICE@)
FFMPEG_FIND(libavdevice avdevice avdevice.h)
endif()
if(@ENABLE_AVFILTER@)
FFMPEG_FIND(libavfilter avfilter avfilter.h)
endif()
if(@ENABLE_AVFORMAT@)
FFMPEG_FIND(libavformat avformat avformat.h)
endif()
if(@ENABLE_AVCODEC@)
FFMPEG_FIND(libavcodec avcodec avcodec.h)
endif()
if(@ENABLE_AVRESAMPLE@)
FFMPEG_FIND(libavresample avresample avresample.h)
endif()
if(@ENABLE_POSTPROC@)
FFMPEG_FIND(libpostproc postproc postprocess.h)
endif()
if(@ENABLE_SWRESAMPLE@)
FFMPEG_FIND(libswresample swresample swresample.h)
endif()
if(@ENABLE_SWSCALE@)
FFMPEG_FIND(libswscale swscale swscale.h)
endif()
FFMPEG_FIND(libavutil avutil avutil.h)
if (FFMPEG_libavutil_FOUND)
list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
list(REMOVE_DUPLICATES FFMPEG_LIBRARY_DIRS)
set(FFMPEG_libavutil_VERSION "@LIBAVUTIL_VERSION@" CACHE STRING "")
if(FFMPEG_libavcodec_FOUND)
set(FFMPEG_libavcodec_VERSION "@LIBAVCODEC_VERSION@" CACHE STRING "")
endif()
if(FFMPEG_libavdevice_FOUND)
set(FFMPEG_libavdevice_VERSION "@LIBAVDEVICE_VERSION@" CACHE STRING "")
endif()
if(FFMPEG_libavfilter_FOUND)
set(FFMPEG_libavfilter_VERSION "@LIBAVFILTER_VERSION@" CACHE STRING "")
endif()
if(FFMPEG_libavformat_FOUND)
set(FFMPEG_libavformat_VERSION "@LIBAVFORMAT_VERSION@" CACHE STRING "")
endif()
if(FFMPEG_libavresample_FOUND)
set(FFMPEG_libavresample_VERSION "@LIBAVRESAMPLE_VERSION@" CACHE STRING "")
endif()
if(FFMPEG_libswresample_FOUND)
set(FFMPEG_libswresample_VERSION "@LIBSWRESAMPLE_VERSION@" CACHE STRING "")
endif()
if(FFMPEG_libswscale_FOUND)
set(FFMPEG_libswscale_VERSION "@LIBSWSCALE_VERSION@" CACHE STRING "")
endif()
append_dependencies(FFMPEG_DEPS_LIBRARY_RELEASE NAMES "@FFMPEG_DEPENDENCIES_RELEASE@")
append_dependencies(FFMPEG_DEPS_LIBRARY_DEBUG NAMES "@FFMPEG_DEPENDENCIES_DEBUG@" DEBUG)
if(FFMPEG_DEPS_LIBRARY_RELEASE OR FFMPEG_DEPS_LIBRARY_DEBUG)
select_library_configurations(FFMPEG_DEPS)
list(APPEND FFMPEG_LIBRARIES ${FFMPEG_DEPS_LIBRARY})
endif()
set(FFMPEG_LIBRARY ${FFMPEG_LIBRARIES})
set(FFMPEG_FOUND TRUE CACHE BOOL "")
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "")
set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "")
set(FFMPEG_LIBRARY_DIRS ${FFMPEG_LIBRARY_DIRS} CACHE STRING "")
endif()
find_package_handle_standard_args(FFMPEG REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_LIBRARY_DIRS FFMPEG_INCLUDE_DIRS)
endif()

View File

@@ -1,126 +0,0 @@
#!/bin/sh
set -e
export PATH="/usr/bin:$PATH"
command -v cygpath >/dev/null && have_cygpath=1
cygpath() {
if [ -n "$have_cygpath" ]; then
command cygpath "$@"
else
eval _p='$'$#
printf '%s\n' "$_p"
fi
}
move_binary() {
SOURCE=$1
TARGET=$2
BINARY=$3
# run lipo over the command to check whether it really
# is a binary that we need to merge architectures
lipo $SOURCE/$BINARY -info &> /dev/null || return 0
# get the directory name the file is in
DIRNAME=$(dirname $BINARY)
# ensure the directory to move the binary to exists
mkdir -p $TARGET/$DIRNAME
# now finally move the binary
mv $SOURCE/$BINARY $TARGET/$BINARY
}
move_binaries() {
SOURCE=$1
TARGET=$2
[ ! -d $SOURCE ] && return 0
pushd $SOURCE
for BINARY in $(find . -type f); do
move_binary $SOURCE $TARGET $BINARY
done
popd
}
merge_binaries() {
TARGET=$1
SOURCE=$2
shift
shift
pushd $SOURCE/$1
BINARIES=$(find . -type f)
popd
for BINARY in $BINARIES; do
COMMAND="lipo -create -output $TARGET/$BINARY"
for ARCH in $@; do
COMMAND="$COMMAND -arch $ARCH $SOURCE/$ARCH/$BINARY"
done
$($COMMAND)
done
}
export PKG_CONFIG_PATH="$(cygpath -p "${PKG_CONFIG_PATH}")"
# Export HTTP(S)_PROXY as http(s)_proxy:
[ -n "$HTTP_PROXY" ] && export http_proxy="$HTTP_PROXY"
[ -n "$HTTPS_PROXY" ] && export https_proxy="$HTTPS_PROXY"
PATH_TO_BUILD_DIR=$( cygpath "@BUILD_DIR@")
PATH_TO_SRC_DIR=$( cygpath "@SOURCE_PATH@")
PATH_TO_PACKAGE_DIR=$(cygpath "@INST_PREFIX@")
JOBS=@VCPKG_CONCURRENCY@
OSX_ARCHS="@OSX_ARCHS@"
OSX_ARCH_COUNT=0@OSX_ARCH_COUNT@
# Default to hardware concurrency if unset.
: ${JOBS:=$(nproc)}
build_ffmpeg() {
echo "=== CONFIGURING ==="
sh "$PATH_TO_SRC_DIR/configure" "--prefix=$PATH_TO_PACKAGE_DIR" "--cc=$CC" @CONFIGURE_OPTIONS@ $@
echo "=== BUILDING ==="
make -j${JOBS} V=1
echo "=== INSTALLING ==="
make install
}
cd "$PATH_TO_BUILD_DIR"
if [ $OSX_ARCH_COUNT -gt 1 ]; then
for ARCH in $OSX_ARCHS; do
echo "=== CLEANING FOR $ARCH ==="
make clean && make distclean
build_ffmpeg --enable-cross-compile --arch=$ARCH --extra-cflags=-arch --extra-cflags=$ARCH --extra-ldflags=-arch --extra-ldflags=$ARCH
echo "=== COLLECTING BINARIES FOR $ARCH ==="
move_binaries $PATH_TO_PACKAGE_DIR/lib $PATH_TO_BUILD_DIR/stage/$ARCH/lib
move_binaries $PATH_TO_PACKAGE_DIR/bin $PATH_TO_BUILD_DIR/stage/$ARCH/bin
done
echo "=== MERGING ARCHITECTURES ==="
merge_binaries $PATH_TO_PACKAGE_DIR $PATH_TO_BUILD_DIR/stage $OSX_ARCHS
else
build_ffmpeg
fi

View File

@@ -1,826 +0,0 @@
if(VCPKG_TARGET_IS_WINDOWS)
set(PATCHES 0017-Patch-for-ticket-9019-CUDA-Compile-Broken-Using-MSVC.patch) # https://trac.ffmpeg.org/ticket/9019
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ffmpeg/ffmpeg
REF n4.4.5
SHA512 09338a10b31f0e551735b9aa57e2c22ceae15bbbca1ee04535587ff55f181e187a77ede4e70d8cd0e1e7c85fb27a7e513c93b91848013e997263d58780b8fa49
HEAD_REF master
PATCHES
0001-create-lib-libraries.patch
0003-fix-windowsinclude.patch
0004-fix-debug-build.patch
0006-fix-StaticFeatures.patch
0007-fix-lib-naming.patch
0009-Fix-fdk-detection.patch
0010-Fix-x264-detection.patch
0011-Fix-x265-detection.patch
#0012-Fix-ssl-110-detection.patch
0013-define-WINVER.patch
0014-avfilter-dependency-fix.patch # https://ffmpeg.org/pipermail/ffmpeg-devel/2021-February/275819.html
0015-Fix-xml2-detection.patch
${PATCHES}
0018-libaom-Dont-use-aom_codec_av1_dx_algo.patch
0019-libx264-Do-not-explicitly-set-X264_API_IMPORTS.patch
0020-fix-aarch64-libswscale.patch
0022-fix-m1-hardware-decode-nal-bits.patch # remove in next version
0023-fix-qsv-init.patch # remove in next version (5.x)
)
if (SOURCE_PATH MATCHES " ")
message(FATAL_ERROR "Error: ffmpeg will not build with spaces in the path. Please use a directory with no spaces")
endif()
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
# ffmpeg nasm build gives link error on x86, so fall back to yasm
vcpkg_find_acquire_program(YASM)
get_filename_component(YASM_EXE_PATH "${YASM}" DIRECTORY)
vcpkg_add_to_path("${YASM_EXE_PATH}")
else()
vcpkg_find_acquire_program(NASM)
get_filename_component(NASM_EXE_PATH "${NASM}" DIRECTORY)
vcpkg_add_to_path("${NASM_EXE_PATH}")
endif()
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
#We're assuming that if we're building for Windows we're using MSVC
set(INCLUDE_VAR "INCLUDE")
set(LIB_PATH_VAR "LIB")
else()
set(INCLUDE_VAR "CPATH")
set(LIB_PATH_VAR "LIBRARY_PATH")
endif()
set(OPTIONS "--enable-pic --disable-doc --enable-debug --enable-runtime-cpudetect")
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(OPTIONS "${OPTIONS} --disable-asm --disable-x86asm")
endif()
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(OPTIONS "${OPTIONS} --enable-asm --disable-x86asm")
endif()
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(OPTIONS "${OPTIONS} --enable-asm --enable-x86asm")
endif()
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_acquire_msys(MSYS_ROOT)
set(SHELL "${MSYS_ROOT}/usr/bin/bash.exe")
else()
set(SHELL /bin/sh)
endif()
if(VCPKG_TARGET_IS_MINGW)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
string(APPEND OPTIONS " --target-os=mingw32")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
string(APPEND OPTIONS " --target-os=mingw64")
endif()
elseif(VCPKG_TARGET_IS_LINUX)
string(APPEND OPTIONS " --target-os=linux")
elseif(VCPKG_TARGET_IS_WINDOWS)
string(APPEND OPTIONS " --target-os=win32")
elseif(VCPKG_TARGET_IS_OSX)
string(APPEND OPTIONS " --target-os=darwin")
elseif(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Android")
string(APPEND OPTIONS " --target-os=android")
else()
endif()
vcpkg_cmake_get_vars(cmake_vars_file)
include("${cmake_vars_file}")
if(VCPKG_DETECTED_MSVC)
set(OPTIONS "--toolchain=msvc ${OPTIONS}")
# This is required because ffmpeg depends upon optimizations to link correctly
string(APPEND VCPKG_COMBINED_C_FLAGS_DEBUG " -O2")
string(REGEX REPLACE "(^| )-RTC1( |$)" " " VCPKG_COMBINED_C_FLAGS_DEBUG "${VCPKG_COMBINED_C_FLAGS_DEBUG}")
string(REGEX REPLACE "(^| )-Od( |$)" " " VCPKG_COMBINED_C_FLAGS_DEBUG "${VCPKG_COMBINED_C_FLAGS_DEBUG}")
string(REGEX REPLACE "(^| )-Ob0( |$)" " " VCPKG_COMBINED_C_FLAGS_DEBUG "${VCPKG_COMBINED_C_FLAGS_DEBUG}")
endif()
string(APPEND VCPKG_COMBINED_C_FLAGS_DEBUG " -I \"${CURRENT_INSTALLED_DIR}/include\"")
string(APPEND VCPKG_COMBINED_C_FLAGS_RELEASE " -I \"${CURRENT_INSTALLED_DIR}/include\"")
set(_csc_PROJECT_PATH ffmpeg)
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
set(FFMPEG_PKGCONFIG_MODULES libavutil)
if("nonfree" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-nonfree")
endif()
if("gpl" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-gpl")
endif()
if("version3" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-version3")
endif()
if("amf" IN_LIST FEATURES)
# Do nothing
else()
set(OPTIONS "${OPTIONS} --disable-amf")
endif()
if("ffmpeg" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-ffmpeg")
else()
set(OPTIONS "${OPTIONS} --disable-ffmpeg")
endif()
if("ffplay" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-ffplay")
else()
set(OPTIONS "${OPTIONS} --disable-ffplay")
endif()
if("ffprobe" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-ffprobe")
else()
set(OPTIONS "${OPTIONS} --disable-ffprobe")
endif()
if (NOT "alsa" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --disable-alsa")
endif()
if("avcodec" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-avcodec")
set(ENABLE_AVCODEC ON)
list(APPEND FFMPEG_PKGCONFIG_MODULES libavcodec)
else()
set(OPTIONS "${OPTIONS} --disable-avcodec")
set(ENABLE_AVCODEC OFF)
endif()
if("avdevice" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-avdevice")
set(ENABLE_AVDEVICE ON)
list(APPEND FFMPEG_PKGCONFIG_MODULES libavdevice)
else()
set(OPTIONS "${OPTIONS} --disable-avdevice")
set(ENABLE_AVDEVICE OFF)
endif()
if("avformat" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-avformat")
set(ENABLE_AVFORMAT ON)
list(APPEND FFMPEG_PKGCONFIG_MODULES libavformat)
else()
set(OPTIONS "${OPTIONS} --disable-avformat")
set(ENABLE_AVFORMAT OFF)
endif()
if("avfilter" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-avfilter")
set(ENABLE_AVFILTER ON)
list(APPEND FFMPEG_PKGCONFIG_MODULES libavfilter)
else()
set(OPTIONS "${OPTIONS} --disable-avfilter")
set(ENABLE_AVFILTER OFF)
endif()
if("postproc" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-postproc")
set(ENABLE_POSTPROC ON)
list(APPEND FFMPEG_PKGCONFIG_MODULES libpostproc)
else()
set(OPTIONS "${OPTIONS} --disable-postproc")
set(ENABLE_POSTPROC OFF)
endif()
if("swresample" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-swresample")
set(ENABLE_SWRESAMPLE ON)
list(APPEND FFMPEG_PKGCONFIG_MODULES libswresample)
else()
set(OPTIONS "${OPTIONS} --disable-swresample")
set(ENABLE_SWRESAMPLE OFF)
endif()
if("swscale" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-swscale")
set(ENABLE_SWSCALE ON)
list(APPEND FFMPEG_PKGCONFIG_MODULES libswscale)
else()
set(OPTIONS "${OPTIONS} --disable-swscale")
set(ENABLE_SWSCALE OFF)
endif()
set(ENABLE_AVRESAMPLE OFF)
if("avresample" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-avresample")
set(ENABLE_AVRESAMPLE ON)
list(APPEND FFMPEG_PKGCONFIG_MODULES libavresample)
endif()
set(STATIC_LINKAGE OFF)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(STATIC_LINKAGE ON)
endif()
if("aom" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libaom")
else()
set(OPTIONS "${OPTIONS} --disable-libaom")
endif()
if("ass" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libass")
else()
set(OPTIONS "${OPTIONS} --disable-libass")
endif()
if("avisynthplus" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-avisynth")
else()
set(OPTIONS "${OPTIONS} --disable-avisynth")
endif()
if("bzip2" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-bzlib")
else()
set(OPTIONS "${OPTIONS} --disable-bzlib")
endif()
if("dav1d" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libdav1d")
else()
set(OPTIONS "${OPTIONS} --disable-libdav1d")
endif()
if("fdk-aac" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libfdk-aac")
else()
set(OPTIONS "${OPTIONS} --disable-libfdk-aac")
endif()
if("fontconfig" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libfontconfig")
else()
set(OPTIONS "${OPTIONS} --disable-libfontconfig")
endif()
if("freetype" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libfreetype")
else()
set(OPTIONS "${OPTIONS} --disable-libfreetype")
endif()
if("fribidi" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libfribidi")
else()
set(OPTIONS "${OPTIONS} --disable-libfribidi")
endif()
if("iconv" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-iconv")
else()
set(OPTIONS "${OPTIONS} --disable-iconv")
endif()
if("ilbc" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libilbc")
else()
set(OPTIONS "${OPTIONS} --disable-libilbc")
endif()
if("lzma" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-lzma")
else()
set(OPTIONS "${OPTIONS} --disable-lzma")
endif()
if("mp3lame" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libmp3lame")
else()
set(OPTIONS "${OPTIONS} --disable-libmp3lame")
endif()
if("modplug" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libmodplug")
else()
set(OPTIONS "${OPTIONS} --disable-libmodplug")
endif()
if("nvcodec" IN_LIST FEATURES)
#Note: the --enable-cuda option does not actually require the cuda sdk or toolset port dependency as ffmpeg uses runtime detection and dynamic loading
set(OPTIONS "${OPTIONS} --enable-cuda --enable-nvenc --enable-nvdec --enable-cuvid --enable-ffnvcodec")
else()
set(OPTIONS "${OPTIONS} --disable-cuda --disable-nvenc --disable-nvdec --disable-cuvid --disable-ffnvcodec")
endif()
if("opencl" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-opencl")
else()
set(OPTIONS "${OPTIONS} --disable-opencl")
endif()
if("opengl" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-opengl")
else()
set(OPTIONS "${OPTIONS} --disable-opengl")
endif()
if("openh264" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libopenh264")
else()
set(OPTIONS "${OPTIONS} --disable-libopenh264")
endif()
if("openjpeg" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libopenjpeg")
else()
set(OPTIONS "${OPTIONS} --disable-libopenjpeg")
endif()
if("openmpt" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libopenmpt")
else()
set(OPTIONS "${OPTIONS} --disable-libopenmpt")
endif()
if("openssl" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-openssl")
else()
set(OPTIONS "${OPTIONS} --disable-openssl")
endif()
if("opus" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libopus")
else()
set(OPTIONS "${OPTIONS} --disable-libopus")
endif()
if("sdl2" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-sdl2")
else()
set(OPTIONS "${OPTIONS} --disable-sdl2")
endif()
if("snappy" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libsnappy")
else()
set(OPTIONS "${OPTIONS} --disable-libsnappy")
endif()
if("soxr" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libsoxr")
else()
set(OPTIONS "${OPTIONS} --disable-libsoxr")
endif()
if("speex" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libspeex")
else()
set(OPTIONS "${OPTIONS} --disable-libspeex")
endif()
if("ssh" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libssh")
else()
set(OPTIONS "${OPTIONS} --disable-libssh")
endif()
if("tensorflow" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libtensorflow")
else()
set(OPTIONS "${OPTIONS} --disable-libtensorflow")
endif()
if("tesseract" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libtesseract")
else()
set(OPTIONS "${OPTIONS} --disable-libtesseract")
endif()
if("theora" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libtheora")
else()
set(OPTIONS "${OPTIONS} --disable-libtheora")
endif()
if("vorbis" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libvorbis")
else()
set(OPTIONS "${OPTIONS} --disable-libvorbis")
endif()
if("vpx" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libvpx")
else()
set(OPTIONS "${OPTIONS} --disable-libvpx")
endif()
if("webp" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libwebp")
else()
set(OPTIONS "${OPTIONS} --disable-libwebp")
endif()
if("x264" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libx264")
else()
set(OPTIONS "${OPTIONS} --disable-libx264")
endif()
if("x265" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libx265")
else()
set(OPTIONS "${OPTIONS} --disable-libx265")
endif()
if("xml2" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libxml2")
else()
set(OPTIONS "${OPTIONS} --disable-libxml2")
endif()
if("zlib" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-zlib")
else()
set(OPTIONS "${OPTIONS} --disable-zlib")
endif()
if ("srt" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libsrt")
else()
set(OPTIONS "${OPTIONS} --disable-libsrt")
endif()
if ("qsv" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libmfx --enable-encoder=h264_qsv --enable-decoder=h264_qsv")
endif()
if (VCPKG_TARGET_IS_OSX)
set(OPTIONS "${OPTIONS} --disable-vdpau") # disable vdpau in OSX
endif()
if(VCPKG_TARGET_IS_IOS)
set(OPTIONS "${OPTIONS} --disable-audiotoolbox") # disable AudioToolbox on iOS
endif()
set(OPTIONS_CROSS " --enable-cross-compile")
# ffmpeg needs --cross-prefix option to use appropriate tools for cross-compiling.
if(VCPKG_DETECTED_CMAKE_C_COMPILER MATCHES "([^\/]*-)gcc$")
string(APPEND OPTIONS_CROSS " --cross-prefix=${CMAKE_MATCH_1}")
endif()
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
string(APPEND OPTIONS_CROSS " --arch=x86_64")
else()
string(APPEND OPTIONS_CROSS " --arch=${VCPKG_TARGET_ARCHITECTURE}")
endif()
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_find_acquire_program(GASPREPROCESSOR)
foreach(GAS_PATH ${GASPREPROCESSOR})
get_filename_component(GAS_ITEM_PATH ${GAS_PATH} DIRECTORY)
set(ENV{PATH} "$ENV{PATH}${VCPKG_HOST_PATH_SEPARATOR}${GAS_ITEM_PATH}")
endforeach(GAS_PATH)
endif()
endif()
if(VCPKG_TARGET_IS_UWP)
set(ENV{LIBPATH} "$ENV{LIBPATH};$ENV{_WKITS10}references\\windows.foundation.foundationcontract\\2.0.0.0\\;$ENV{_WKITS10}references\\windows.foundation.universalapicontract\\3.0.0.0\\")
string(APPEND OPTIONS " --disable-programs")
string(APPEND OPTIONS " --extra-cflags=-DWINAPI_FAMILY=WINAPI_FAMILY_APP --extra-cflags=-D_WIN32_WINNT=0x0A00")
string(APPEND OPTIONS " --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib")
endif()
# Note: --disable-optimizations can't be used due to https://ffmpeg.org/pipermail/libav-user/2013-March/003945.html
set(OPTIONS_DEBUG "--debug")
set(OPTIONS_RELEASE "")
set(OPTIONS "${OPTIONS} ${OPTIONS_CROSS}")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
set(OPTIONS "${OPTIONS} --disable-static --enable-shared")
endif()
if(VCPKG_TARGET_IS_MINGW)
set(OPTIONS "${OPTIONS} --extra_cflags=-D_WIN32_WINNT=0x0601")
elseif(VCPKG_TARGET_IS_WINDOWS)
set(OPTIONS "${OPTIONS} --extra-cflags=-DHAVE_UNISTD_H=0")
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(OPTIONS "${OPTIONS} --pkg-config-flags=--static")
endif()
set(ENV_LIB_PATH "$ENV{${LIB_PATH_VAR}}")
get_filename_component(CC_path "${VCPKG_DETECTED_CMAKE_C_COMPILER}" DIRECTORY)
get_filename_component(CC_filename "${VCPKG_DETECTED_CMAKE_C_COMPILER}" NAME)
set(ENV{CC} "${CC_filename}")
if(CC_path)
vcpkg_add_to_path(PREPEND "${CC_path}")
endif()
message(STATUS "Building Options: ${OPTIONS}")
# Release build
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
message(STATUS "Building Release Options: ${OPTIONS_RELEASE}")
set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/lib${VCPKG_HOST_PATH_SEPARATOR}${ENV_LIB_PATH}")
set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig")
message(STATUS "Building ${_csc_PROJECT_PATH} for Release")
file(MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
# We use response files here as the only known way to handle spaces in paths
set(crsp "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/cflags.rsp")
file(WRITE "${crsp}" "${VCPKG_COMBINED_C_FLAGS_RELEASE}")
set(ldrsp "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/ldflags.rsp")
file(WRITE "${ldrsp}" "${VCPKG_COMBINED_SHARED_LINKER_FLAGS_RELEASE}")
set(ENV{CFLAGS} "@${crsp}")
# All tools except the msvc arm{,64} assembler accept @... as response file syntax.
# For that assembler, there is no known way to pass in flags. We must hope that not passing flags will work acceptably.
if(NOT VCPKG_DETECTED_MSVC OR NOT VCPKG_TARGET_ARCHITECTURE MATCHES "^arm")
set(ENV{ASFLAGS} "@${crsp}")
endif()
set(ENV{LDFLAGS} "@${ldrsp}")
set(BUILD_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel")
set(CONFIGURE_OPTIONS "${OPTIONS} ${OPTIONS_RELEASE}")
set(INST_PREFIX "${CURRENT_PACKAGES_DIR}")
configure_file("${CMAKE_CURRENT_LIST_DIR}/build.sh.in" "${BUILD_DIR}/build.sh" @ONLY)
vcpkg_execute_required_process(
COMMAND "${SHELL}" ./build.sh
WORKING_DIRECTORY "${BUILD_DIR}"
LOGNAME "build-${TARGET_TRIPLET}-rel"
)
endif()
# Debug build
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
message(STATUS "Building Debug Options: ${OPTIONS_DEBUG}")
set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/debug/lib${VCPKG_HOST_PATH_SEPARATOR}${ENV_LIB_PATH}")
set(ENV{LDFLAGS} "${VCPKG_COMBINED_SHARED_LINKER_FLAGS_DEBUG}")
set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig")
message(STATUS "Building ${_csc_PROJECT_PATH} for Debug")
file(MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
set(crsp "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/cflags.rsp")
file(WRITE "${crsp}" "${VCPKG_COMBINED_C_FLAGS_DEBUG}")
set(ldrsp "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/ldflags.rsp")
file(WRITE "${ldrsp}" "${VCPKG_COMBINED_SHARED_LINKER_FLAGS_DEBUG}")
set(ENV{CFLAGS} "@${crsp}")
if(NOT VCPKG_DETECTED_MSVC OR NOT VCPKG_TARGET_ARCHITECTURE MATCHES "^arm")
set(ENV{ASFLAGS} "@${crsp}")
endif()
set(ENV{LDFLAGS} "@${ldrsp}")
set(BUILD_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg")
set(CONFIGURE_OPTIONS "${OPTIONS} ${OPTIONS_DEBUG}")
set(INST_PREFIX "${CURRENT_PACKAGES_DIR}/debug")
configure_file("${CMAKE_CURRENT_LIST_DIR}/build.sh.in" "${BUILD_DIR}/build.sh" @ONLY)
vcpkg_execute_required_process(
COMMAND "${SHELL}" ./build.sh
WORKING_DIRECTORY "${BUILD_DIR}"
LOGNAME "build-${TARGET_TRIPLET}-dbg"
)
endif()
if(VCPKG_TARGET_IS_WINDOWS)
file(GLOB DEF_FILES "${CURRENT_PACKAGES_DIR}/lib/*.def" "${CURRENT_PACKAGES_DIR}/debug/lib/*.def")
if(NOT VCPKG_TARGET_IS_MINGW)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(LIB_MACHINE_ARG /machine:ARM)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(LIB_MACHINE_ARG /machine:ARM64)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
set(LIB_MACHINE_ARG /machine:x86)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(LIB_MACHINE_ARG /machine:x64)
else()
message(FATAL_ERROR "Unsupported target architecture")
endif()
foreach(DEF_FILE ${DEF_FILES})
get_filename_component(DEF_FILE_DIR "${DEF_FILE}" DIRECTORY)
get_filename_component(DEF_FILE_NAME "${DEF_FILE}" NAME)
string(REGEX REPLACE "-[0-9]*\\.def" "${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" OUT_FILE_NAME "${DEF_FILE_NAME}")
file(TO_NATIVE_PATH "${DEF_FILE}" DEF_FILE_NATIVE)
file(TO_NATIVE_PATH "${DEF_FILE_DIR}/${OUT_FILE_NAME}" OUT_FILE_NATIVE)
message(STATUS "Generating ${OUT_FILE_NATIVE}")
vcpkg_execute_required_process(
COMMAND lib.exe "/def:${DEF_FILE_NATIVE}" "/out:${OUT_FILE_NATIVE}" ${LIB_MACHINE_ARG}
WORKING_DIRECTORY "${CURRENT_PACKAGES_DIR}"
LOGNAME "libconvert-${TARGET_TRIPLET}"
)
endforeach()
endif()
file(GLOB EXP_FILES "${CURRENT_PACKAGES_DIR}/lib/*.exp" "${CURRENT_PACKAGES_DIR}/debug/lib/*.exp")
file(GLOB LIB_FILES "${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}" "${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX}")
if(VCPKG_TARGET_IS_MINGW)
file(GLOB LIB_FILES_2 "${CURRENT_PACKAGES_DIR}/bin/*.lib" "${CURRENT_PACKAGES_DIR}/debug/bin/*.lib")
endif()
set(files_to_remove ${EXP_FILES} ${LIB_FILES} ${LIB_FILES_2} ${DEF_FILES})
if(files_to_remove)
file(REMOVE ${files_to_remove})
endif()
endif()
if("ffmpeg" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES ffmpeg AUTO_CLEAN)
endif()
if("ffprobe" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES ffprobe AUTO_CLEAN)
endif()
if("ffplay" IN_LIST FEATURES)
vcpkg_copy_tools(TOOL_NAMES ffplay AUTO_CLEAN)
endif()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
vcpkg_copy_pdbs()
if (VCPKG_TARGET_IS_WINDOWS)
set(_dirs "/")
if(NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
list(APPEND _dirs "/debug/")
endif()
foreach(_debug IN LISTS _dirs)
foreach(PKGCONFIG_MODULE IN LISTS FFMPEG_PKGCONFIG_MODULES)
set(PKGCONFIG_FILE "${CURRENT_PACKAGES_DIR}${_debug}lib/pkgconfig/${PKGCONFIG_MODULE}.pc")
# remove redundant cygwin style -libpath entries
execute_process(
COMMAND "${MSYS_ROOT}/usr/bin/cygpath.exe" -u "${CURRENT_INSTALLED_DIR}"
OUTPUT_VARIABLE CYG_INSTALLED_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)
vcpkg_replace_string("${PKGCONFIG_FILE}" "-libpath:${CYG_INSTALLED_DIR}${_debug}lib/pkgconfig/../../lib " "")
# transform libdir, includedir, and prefix paths from cygwin style to windows style
file(READ "${PKGCONFIG_FILE}" PKGCONFIG_CONTENT)
foreach(PATH_NAME prefix libdir includedir)
string(REGEX MATCH "${PATH_NAME}=[^\n]*" PATH_VALUE "${PKGCONFIG_CONTENT}")
string(REPLACE "${PATH_NAME}=" "" PATH_VALUE "${PATH_VALUE}")
if(NOT PATH_VALUE)
message(FATAL_ERROR "failed to find pkgconfig variable ${PATH_NAME}")
endif()
execute_process(
COMMAND "${MSYS_ROOT}/usr/bin/cygpath.exe" -w "${PATH_VALUE}"
OUTPUT_VARIABLE FIXED_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
file(TO_CMAKE_PATH "${FIXED_PATH}" FIXED_PATH)
vcpkg_replace_string("${PKGCONFIG_FILE}" "${PATH_NAME}=${PATH_VALUE}" "${PATH_NAME}=${FIXED_PATH}")
endforeach()
# list libraries with -l flag (so pkgconf knows they are libraries and not just linker flags)
foreach(LIBS_ENTRY Libs Libs.private)
string(REGEX MATCH "${LIBS_ENTRY}: [^\n]*" LIBS_VALUE "${PKGCONFIG_CONTENT}")
if(NOT LIBS_VALUE)
message(FATAL_ERROR "failed to find pkgconfig entry ${LIBS_ENTRY}")
endif()
string(REPLACE "${LIBS_ENTRY}: " "" LIBS_VALUE "${LIBS_VALUE}")
if(LIBS_VALUE)
set(LIBS_VALUE_OLD "${LIBS_VALUE}")
string(REGEX REPLACE "([^ ]+)[.]lib" "-l\\1" LIBS_VALUE "${LIBS_VALUE}")
set(LIBS_VALUE_NEW "${LIBS_VALUE}")
vcpkg_replace_string("${PKGCONFIG_FILE}" "${LIBS_ENTRY}: ${LIBS_VALUE_OLD}" "${LIBS_ENTRY}: ${LIBS_VALUE_NEW}")
endif()
endforeach()
endforeach()
endforeach()
endif()
vcpkg_fixup_pkgconfig()
# Handle dependencies
x_vcpkg_pkgconfig_get_modules(PREFIX FFMPEG_PKGCONFIG MODULES ${FFMPEG_PKGCONFIG_MODULES} LIBS)
function(append_dependencies_from_libs out)
cmake_parse_arguments(PARSE_ARGV 1 "arg" "" "LIBS" "")
string(REGEX REPLACE "[ ]+" ";" contents "${arg_LIBS}")
list(FILTER contents EXCLUDE REGEX "^-framework$")
list(FILTER contents EXCLUDE REGEX "^-L.+")
list(FILTER contents EXCLUDE REGEX "^-libpath:.+")
list(TRANSFORM contents REPLACE "^-Wl,-framework," "-l")
list(FILTER contents EXCLUDE REGEX "^-Wl,.+")
list(TRANSFORM contents REPLACE "^-l" "")
list(FILTER contents EXCLUDE REGEX "^avresample$")
list(FILTER contents EXCLUDE REGEX "^avutil$")
list(FILTER contents EXCLUDE REGEX "^avcodec$")
list(FILTER contents EXCLUDE REGEX "^avdevice$")
list(FILTER contents EXCLUDE REGEX "^avfilter$")
list(FILTER contents EXCLUDE REGEX "^avformat$")
list(FILTER contents EXCLUDE REGEX "^postproc$")
list(FILTER contents EXCLUDE REGEX "^swresample$")
list(FILTER contents EXCLUDE REGEX "^swscale$")
list(FILTER contents EXCLUDE REGEX "^atomic$")
if(VCPKG_TARGET_IS_WINDOWS)
list(TRANSFORM contents TOLOWER)
endif()
if(contents)
list(APPEND "${out}" "${contents}")
set("${out}" "${${out}}" PARENT_SCOPE)
endif()
endfunction()
append_dependencies_from_libs(FFMPEG_DEPENDENCIES_RELEASE LIBS "${FFMPEG_PKGCONFIG_LIBS_RELEASE}")
append_dependencies_from_libs(FFMPEG_DEPENDENCIES_DEBUG LIBS "${FFMPEG_PKGCONFIG_LIBS_DEBUG}")
# must remove duplicates from the front to respect link order so reverse first
list(REVERSE FFMPEG_DEPENDENCIES_RELEASE)
list(REVERSE FFMPEG_DEPENDENCIES_DEBUG)
list(REMOVE_DUPLICATES FFMPEG_DEPENDENCIES_RELEASE)
list(REMOVE_DUPLICATES FFMPEG_DEPENDENCIES_DEBUG)
list(REVERSE FFMPEG_DEPENDENCIES_RELEASE)
list(REVERSE FFMPEG_DEPENDENCIES_DEBUG)
message(STATUS "Dependencies (release): ${FFMPEG_DEPENDENCIES_RELEASE}")
message(STATUS "Dependencies (debug): ${FFMPEG_DEPENDENCIES_DEBUG}")
# Handle version strings
function(extract_regex_from_file out)
cmake_parse_arguments(PARSE_ARGV 1 "arg" "" "FILE;REGEX" "")
file(READ "${arg_FILE}" contents)
if (contents MATCHES "${arg_REGEX}")
if(NOT CMAKE_MATCH_COUNT EQUAL 1)
message(FATAL_ERROR "Could not identify match group in regular expression \"${arg_REGEX}\"")
endif()
else()
message(FATAL_ERROR "Could not find line matching \"${arg_REGEX}\" in file \"${arg_FILE}\"")
endif()
set("${out}" "${CMAKE_MATCH_1}" PARENT_SCOPE)
endfunction()
function(extract_version_from_component out)
cmake_parse_arguments(PARSE_ARGV 1 "arg" "" "COMPONENT" "")
string(TOLOWER "${arg_COMPONENT}" component_lower)
string(TOUPPER "${arg_COMPONENT}" component_upper)
extract_regex_from_file(major_version
FILE "${SOURCE_PATH}/${component_lower}/version.h"
REGEX "#define ${component_upper}_VERSION_MAJOR[ ]+([0-9]+)"
)
extract_regex_from_file(minor_version
FILE "${SOURCE_PATH}/${component_lower}/version.h"
REGEX "#define ${component_upper}_VERSION_MINOR[ ]+([0-9]+)"
)
extract_regex_from_file(micro_version
FILE "${SOURCE_PATH}/${component_lower}/version.h"
REGEX "#define ${component_upper}_VERSION_MICRO[ ]+([0-9]+)"
)
set("${out}" "${major_version}.${minor_version}.${micro_version}" PARENT_SCOPE)
endfunction()
extract_regex_from_file(FFMPEG_VERSION
FILE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/libavutil/ffversion.h"
REGEX "#define FFMPEG_VERSION[ ]+\"(.+)\""
)
extract_version_from_component(LIBAVUTIL_VERSION
COMPONENT libavutil)
extract_version_from_component(LIBAVCODEC_VERSION
COMPONENT libavcodec)
extract_version_from_component(LIBAVDEVICE_VERSION
COMPONENT libavdevice)
extract_version_from_component(LIBAVFILTER_VERSION
COMPONENT libavfilter)
extract_version_from_component( LIBAVFORMAT_VERSION
COMPONENT libavformat)
extract_version_from_component(LIBAVRESAMPLE_VERSION
COMPONENT libavresample)
extract_version_from_component(LIBSWRESAMPLE_VERSION
COMPONENT libswresample)
extract_version_from_component(LIBSWSCALE_VERSION
COMPONENT libswscale)
# Handle copyright
file(STRINGS "${CURRENT_BUILDTREES_DIR}/build-${TARGET_TRIPLET}-rel-out.log" LICENSE_STRING REGEX "License: .*" LIMIT_COUNT 1)
if(LICENSE_STRING STREQUAL "License: LGPL version 2.1 or later")
set(LICENSE_FILE "COPYING.LGPLv2.1")
elseif(LICENSE_STRING STREQUAL "License: LGPL version 3 or later")
set(LICENSE_FILE "COPYING.LGPLv3")
elseif(LICENSE_STRING STREQUAL "License: GPL version 2 or later")
set(LICENSE_FILE "COPYING.GPLv2")
elseif(LICENSE_STRING STREQUAL "License: GPL version 3 or later")
set(LICENSE_FILE "COPYING.GPLv3")
elseif(LICENSE_STRING STREQUAL "License: nonfree and unredistributable")
set(LICENSE_FILE "COPYING.NONFREE")
file(WRITE "${SOURCE_PATH}/${LICENSE_FILE}" "${LICENSE_STRING}")
else()
message(FATAL_ERROR "Failed to identify license (${LICENSE_STRING})")
endif()
configure_file("${CMAKE_CURRENT_LIST_DIR}/FindFFMPEG.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/FindFFMPEG.cmake" @ONLY)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/${LICENSE_FILE}" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@@ -1,6 +0,0 @@
To use ffmpeg add the following to your CMake project:
find_package(FFMPEG REQUIRED)
target_include_directories(main PRIVATE ${FFMPEG_INCLUDE_DIRS})
target_link_directories(main PRIVATE ${FFMPEG_LIBRARY_DIRS})
target_link_libraries(main PRIVATE ${FFMPEG_LIBRARIES})

View File

@@ -1,8 +0,0 @@
set(FFMPEG_PREV_MODULE_PATH ${CMAKE_MODULE_PATH})
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
cmake_policy(SET CMP0012 NEW)
_find_package(${ARGS})
set(CMAKE_MODULE_PATH ${FFMPEG_PREV_MODULE_PATH})

View File

@@ -1,676 +0,0 @@
{
"name": "ffmpeg",
"version": "4.4.5",
"port-version": 0,
"description": [
"a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.",
"FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations."
],
"homepage": "https://ffmpeg.org",
"license": null,
"dependencies": [
{
"name": "vcpkg-cmake-get-vars",
"host": true
},
{
"name": "vcpkg-pkgconfig-get-modules",
"host": true
}
],
"default-features": [
"avcodec",
"avdevice",
"avfilter",
"avformat",
"swresample",
"swscale"
],
"features": {
"all": {
"description": "Build with all allowed dependencies selected that are compatible with the lgpl license",
"dependencies": [
{
"name": "ffmpeg",
"default-features": false,
"features": [
"avcodec",
"avdevice",
"avfilter",
"avformat",
"avresample",
"bzip2",
"freetype",
"iconv",
"lzma",
"mp3lame",
"openjpeg",
"opus",
"snappy",
"soxr",
"speex",
"swresample",
"swscale",
"theora",
"vorbis",
"vpx",
"webp",
"xml2",
"zlib"
]
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"alsa"
],
"platform": "linux"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"sdl2"
],
"platform": "!osx"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"ass"
],
"platform": "!uwp"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"fontconfig"
],
"platform": "!uwp"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"fribidi"
],
"platform": "!uwp"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"modplug"
],
"platform": "!uwp"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"opencl"
],
"platform": "!uwp"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"openh264"
],
"platform": "!uwp"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"srt"
],
"platform": "!uwp"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"ilbc"
],
"platform": "!(arm & uwp)"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"ssh"
],
"platform": "!(uwp | arm)"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"tensorflow"
],
"platform": "x64 & !static & !uwp"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"aom"
],
"platform": "!(windows & arm & !uwp)"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"dav1d"
],
"platform": "!(uwp | arm | x86 | osx)"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"opengl"
],
"platform": "!uwp & !(arm64 & windows)"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"tesseract"
],
"platform": "!(windows & arm) & !static & !uwp"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"nvcodec"
],
"platform": "linux | (!osx & !uwp & !(arm64 & windows))"
}
]
},
"all-gpl": {
"description": "Build with all allowed dependencies selected that are compatible with the gpl license",
"dependencies": [
{
"name": "ffmpeg",
"default-features": false,
"features": [
"all",
"gpl",
"postproc"
]
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"x264"
],
"platform": "!(arm & windows)"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"x265"
],
"platform": "!uwp & !(arm & windows)"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"avisynthplus"
],
"platform": "windows & !arm & !uwp & !static"
}
]
},
"all-nonfree": {
"description": "Build with all allowed dependencies selected with a non-redistributable license",
"dependencies": [
{
"name": "ffmpeg",
"default-features": false,
"features": [
"all-gpl",
"fdk-aac",
"nonfree",
"openssl"
]
}
]
},
"alsa": {
"description": "Enable ALSA support",
"dependencies": [
"alsa"
]
},
"amf": {
"description": "AMD AMF codec support",
"dependencies": [
"amd-amf"
]
},
"aom": {
"description": "AV1 video encoding/decoding via libaom support in ffmpeg",
"dependencies": [
"aom"
]
},
"ass": {
"description": "Libass subtitles rendering, needed for subtitles and ass filter support in ffmpeg",
"dependencies": [
"libass"
]
},
"avcodec": {
"description": "Build the avcodec library"
},
"avdevice": {
"description": "Build the avdevice library",
"dependencies": [
{
"name": "ffmpeg",
"default-features": false,
"features": [
"avcodec",
"avformat"
]
}
]
},
"avfilter": {
"description": "Build the avfilter library"
},
"avformat": {
"description": "Build the avformat library",
"dependencies": [
{
"name": "ffmpeg",
"default-features": false,
"features": [
"avcodec"
]
}
]
},
"avisynthplus": {
"description": "Reading of AviSynth script files",
"supports": "windows & !static",
"dependencies": [
"avisynthplus",
{
"name": "ffmpeg",
"default-features": false,
"features": [
"gpl"
]
}
]
},
"avresample": {
"description": "Build the avresample library"
},
"bzip2": {
"description": "Bzip2 support",
"dependencies": [
"bzip2"
]
},
"dav1d": {
"description": "AV1 decoding via libdav1d",
"supports": "!osx",
"dependencies": [
"dav1d"
]
},
"fdk-aac": {
"description": "AAC de/encoding via libfdk-aac, **including GPL-incompatible patent-encumbered HE-AAC**. If you do not require HE-AAC, use the built-in FFmpeg AAC codec.",
"dependencies": [
{
"name": "fdk-aac",
"default-features": false,
"features": [
"he-aac"
]
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"nonfree"
]
}
]
},
"ffmpeg": {
"description": "Build the ffmpeg application",
"supports": "!uwp",
"dependencies": [
{
"name": "ffmpeg",
"default-features": false,
"features": [
"avcodec",
"avfilter",
"avformat"
]
}
]
},
"ffplay": {
"description": "Build the ffplay application",
"supports": "!uwp",
"dependencies": [
{
"name": "ffmpeg",
"default-features": false,
"features": [
"avcodec",
"avfilter",
"avformat",
"sdl2",
"swresample",
"swscale"
]
}
]
},
"ffprobe": {
"description": "Build the ffprobe application",
"supports": "!uwp",
"dependencies": [
{
"name": "ffmpeg",
"default-features": false,
"features": [
"avcodec",
"avformat"
]
}
]
},
"fontconfig": {
"description": "Useful for drawtext filter",
"dependencies": [
"fontconfig"
]
},
"freetype": {
"description": "Needed for drawtext filter",
"dependencies": [
"freetype"
]
},
"fribidi": {
"description": "Improves drawtext filter",
"dependencies": [
"fribidi"
]
},
"gpl": {
"description": "Allow use of GPL code, the resulting libs and binaries will be under GPL"
},
"iconv": {
"description": "Iconv support",
"dependencies": [
"libiconv"
]
},
"ilbc": {
"description": "iLBC de/encoding via libilbc",
"dependencies": [
"libilbc"
]
},
"lzma": {
"description": "lzma support",
"dependencies": [
"liblzma"
]
},
"modplug": {
"description": "ModPlug via libmodplug",
"dependencies": [
"libmodplug"
]
},
"mp3lame": {
"description": "MP3 encoding via libmp3lame",
"dependencies": [
"mp3lame"
]
},
"nonfree": {
"description": "Allow use of nonfree code, the resulting libs and binaries will be unredistributable"
},
"nvcodec": {
"description": "Nvidia video decoding/encoding acceleration",
"supports": "linux | (!osx & !uwp & !(arm64 & windows))",
"dependencies": [
"ffnvcodec"
]
},
"opencl": {
"description": "OpenCL processing",
"supports": "!uwp",
"dependencies": [
"opencl"
]
},
"opengl": {
"description": "OpenGL rendering",
"supports": "!uwp",
"dependencies": [
"opengl",
"opengl-registry"
]
},
"openh264": {
"description": "H.264 de/encoding via openh264",
"dependencies": [
"openh264"
]
},
"openjpeg": {
"description": "JPEG 2000 de/encoding via OpenJPEG",
"dependencies": [
"openjpeg"
]
},
"openmpt": {
"description": "Decoding tracked files via libopenmpt",
"dependencies": [
"libopenmpt"
]
},
"openssl": {
"description": "Needed for https support if gnutls, libtls or mbedtls is not used",
"dependencies": [
{
"name": "ffmpeg",
"default-features": false,
"features": [
"nonfree"
]
},
"openssl"
]
},
"opus": {
"description": "Opus de/encoding via libopus",
"dependencies": [
"opus"
]
},
"postproc": {
"description": "Build the postproc library",
"dependencies": [
{
"name": "ffmpeg",
"default-features": false,
"features": [
"gpl"
]
}
]
},
"qsv": {
"description": "Intel QSV Codec",
"dependencies": [
"mfx-dispatch"
]
},
"sdl2": {
"description": "Sdl2 support",
"dependencies": [
{
"name": "sdl2",
"default-features": false,
"features": [
"x11"
],
"platform": "linux"
},
{
"name": "sdl2",
"platform": "!linux"
}
]
},
"snappy": {
"description": "Snappy compression, needed for hap encoding",
"dependencies": [
"snappy"
]
},
"soxr": {
"description": "Include libsoxr resampling",
"dependencies": [
{
"name": "ffmpeg",
"default-features": false,
"features": [
"swresample"
]
},
"soxr"
]
},
"speex": {
"description": "Speex de/encoding via libspeex",
"dependencies": [
"speex"
]
},
"srt": {
"description": "Haivision SRT protocol",
"supports": "!uwp",
"dependencies": [
"libsrt"
]
},
"ssh": {
"description": "SFTP protocol via libssh",
"dependencies": [
"libssh"
]
},
"swresample": {
"description": "Build the swresample library"
},
"swscale": {
"description": "Build the swscale library"
},
"tensorflow": {
"description": "TensorFlow as a DNN module backend for DNN based filters like sr",
"supports": "!static",
"dependencies": [
"tensorflow"
]
},
"tesseract": {
"description": "Tesseract, needed for ocr filter",
"supports": "!static",
"dependencies": [
"tesseract"
]
},
"theora": {
"description": "Theora encoding via libtheora",
"dependencies": [
"libtheora"
]
},
"version3": {
"description": "Upgrade (L)GPL to version 3"
},
"vorbis": {
"description": "Vorbis en/decoding via libvorbis, native implementation exists",
"dependencies": [
"libvorbis"
]
},
"vpx": {
"description": "VP8 and VP9 de/encoding via libvpx",
"dependencies": [
"libvpx"
]
},
"webp": {
"description": "WebP encoding via libwebp",
"dependencies": [
"libwebp"
]
},
"x264": {
"description": "H.264 encoding via x264",
"dependencies": [
{
"name": "ffmpeg",
"default-features": false,
"features": [
"gpl"
]
},
"x264"
]
},
"x265": {
"description": "HEVC encoding via x265",
"dependencies": [
{
"name": "ffmpeg",
"default-features": false,
"features": [
"gpl"
]
},
"x265"
]
},
"xml2": {
"description": "XML parsing using the C library libxml2, needed for dash demuxing support",
"dependencies": [
"libxml2"
]
},
"zlib": {
"description": "zlib support",
"dependencies": [
"zlib"
]
}
}
}

View File

@@ -1,13 +0,0 @@
diff --git a/configure.ac b/configure.ac
index f6d25f334..3115504e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1592,7 +1592,7 @@ fi
[enable_uaf_detection="0"]
)
if test "x$enable_uaf_detection" = "x1" ; then
- AC_DEFINE([JEMALLOC_UAF_DETECTION], [ ])
+ AC_DEFINE([JEMALLOC_UAF_DETECTION], [ ], ["enable UAF"])
fi
AC_SUBST([enable_uaf_detection])

View File

@@ -1,58 +0,0 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO jemalloc/jemalloc
REF 54eaed1d8b56b1aa528be3bdd1877e59c56fa90c
SHA512 527bfbf5db9a5c2b7b04df4785b6ae9d445cff8cb17298bf3e550c88890d2bd7953642d8efaa417580610508279b527d3a3b9e227d17394fd2013c88cb7ae75a
HEAD_REF master
PATCHES
fix-configure-ac.patch
preprocessor.patch
)
if(VCPKG_TARGET_IS_WINDOWS)
set(opts "ac_cv_search_log=none required" "--without-private-namespace")
endif()
set (opts "${opts}" "--disable-initial-exec-tls")
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
NO_WRAPPERS
OPTIONS ${opts}
)
vcpkg_install_make()
if(VCPKG_TARGET_IS_WINDOWS)
file(COPY "${SOURCE_PATH}/include/msvc_compat/strings.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include/jemalloc/msvc_compat")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/jemalloc/jemalloc.h" "<strings.h>" "\"msvc_compat/strings.h\"")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/jemalloc.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/jemalloc.dll" "${CURRENT_PACKAGES_DIR}/bin/jemalloc.dll")
endif()
if(NOT VCPKG_BUILD_TYPE)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/jemalloc.lib" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/jemalloc.dll" "${CURRENT_PACKAGES_DIR}/debug/bin/jemalloc.dll")
endif()
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/jemalloc.pc" "install_suffix=" "install_suffix=_s")
if(NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/jemalloc.pc" "install_suffix=" "install_suffix=_s")
endif()
endif()
endif()
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools")
# Handle copyright
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@@ -1,12 +0,0 @@
diff --git a/configure.ac b/configure.ac
index 3115504e2..ffb504b08 100644
--- a/configure.ac
+++ b/configure.ac
@@ -749,6 +749,7 @@ case "${host}" in
so="dll"
if test "x$je_cv_msvc" = "xyes" ; then
importlib="lib"
+ JE_APPEND_VS(CPPFLAGS, -DJEMALLOC_NO_PRIVATE_NAMESPACE)
DSO_LDFLAGS="-LD"
EXTRA_LDFLAGS="-link -DEBUG"
CTARGET='-Fo$@'

View File

@@ -1,8 +0,0 @@
{
"name": "jemalloc",
"version": "5.3.0",
"port-version": 1,
"description": "jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support",
"homepage": "https://jemalloc.net/",
"license": "BSD-2-Clause"
}

View File

@@ -0,0 +1,415 @@
From da6b5b83ef997f550155d9087c5e7b289168fb1b Mon Sep 17 00:00:00 2001
From: dpasukhi <dpasukhi@opencascade.com>
Date: Sat, 5 Jul 2025 11:36:01 +0100
Subject: [PATCH] Add support for building and installing Tk in Makefiles for
Unix and Windows
---
unix/Makefile.in | 94 +++++++++++++++++++++++++++++++++++++++++++++--
win/Makefile.in | 68 ++++++++++++++++++++++++++++++++++
win/makefile.vc | 96 +++++++++++++++++++++++++++++++++++++++++++++---
3 files changed, 249 insertions(+), 9 deletions(-)
diff --git a/unix/Makefile.in b/unix/Makefile.in
index bc743b3892..dfdcf35acd 100644
--- a/unix/Makefile.in
+++ b/unix/Makefile.in
@@ -232,6 +232,7 @@ TOOL_DIR = $(TOP_DIR)/tools
UNIX_DIR = $(TOP_DIR)/unix
MAC_OSX_DIR = $(TOP_DIR)/macosx
PKGS_DIR = $(TOP_DIR)/pkgs
+EXTRADIR = $(TOP_DIR)/extra
# Must be absolute because of the cd dltest $(DLTEST_DIR)/configure below.
DLTEST_DIR = @TCL_SRC_DIR@/unix/dltest
# Must be absolute to so the corresponding tcltest's tcl_library is absolute.
@@ -622,7 +623,7 @@ SRCS = $(GENERIC_SRCS) $(UNIX_SRCS) $(NOTIFY_SRCS) \
# Start of rules
#--------------------------------------------------------------------------
-all: binaries libraries doc packages
+all: binaries libraries doc packages extra
binaries: ${LIB_FILE} ${TCL_EXE}
@@ -666,13 +667,13 @@ Makefile: $(UNIX_DIR)/Makefile.in $(DLTEST_DIR)/Makefile.in
#tclConfig.h: $(UNIX_DIR)/tclConfig.h.in
# $(SHELL) config.status
-clean: clean-packages
+clean: clean-packages clean-extra
rm -rf *.a *.o libtcl* core errs *~ \#* TAGS *.E a.out \
errors ${TCL_EXE} ${TCLTEST_EXE} lib.exp Tcl @DTRACE_HDR@ \
minizip${HOST_EXEEXT} *.${HOST_OBJEXT} *.zip *.vfs
(cd dltest ; $(MAKE) clean)
-distclean: distclean-packages clean
+distclean: distclean-packages clean distclean-extra
rm -rf Makefile config.status config.cache config.log tclConfig.sh \
tclConfig.h *.plist Tcl.framework tcl.pc tclUuid.h
(cd dltest ; $(MAKE) distclean)
@@ -795,7 +796,7 @@ INSTALL_EXTRA_TARGETS = @EXTRA_INSTALL@
INSTALL_TARGETS = $(INSTALL_BASE_TARGETS) $(INSTALL_DOC_TARGETS) $(INSTALL_DEV_TARGETS) \
$(INSTALL_PACKAGE_TARGETS) $(INSTALL_EXTRA_TARGETS)
-install: $(INSTALL_TARGETS)
+install: $(INSTALL_TARGETS) install-extra
install-strip:
$(MAKE) $(INSTALL_TARGETS) \
@@ -1725,6 +1726,7 @@ PKG_CFG_ARGS = @PKG_CFG_ARGS@
# cannot use absolute paths due to issues in nested configure when path to
# build dir contains spaces).
PKG_DIR = ./pkgs
+EXTRA_BUILD_DIR = ./extra
configure-packages:
@for i in $(PKGS_DIR)/*; do \
@@ -2151,6 +2153,89 @@ BUILD_HTML = \
--useversion=$(HTML_VERSION) --htmldir="$(HTML_INSTALL_DIR)" \
--srcdir=$(TOP_DIR)/.. $(BUILD_HTML_FLAGS)
+#--------------------------------------------------------------------------
+# Extra packages build targets (for TK and other extras)
+#--------------------------------------------------------------------------
+
+extra:
+ @if test -d "$(EXTRADIR)"; then \
+ for extradir in $(EXTRADIR)/*; do \
+ if test -d "$$extradir/unix" && test -f "$$extradir/unix/configure"; then \
+ extrapkg=`basename $$extradir`; \
+ echo "Building extra package '$$extrapkg'"; \
+ mkdir -p "$(EXTRA_BUILD_DIR)/$$extrapkg"; \
+ TCL_BUILD_DIR="`pwd`"; \
+ if test ! -f "$(EXTRA_BUILD_DIR)/$$extrapkg/Makefile"; then \
+ echo "Configuring extra package '$$extrapkg'"; \
+ (cd "$(EXTRA_BUILD_DIR)/$$extrapkg" && \
+ "$$extradir/unix/configure" \
+ --prefix="$(prefix)" \
+ --exec-prefix="$(exec_prefix)" \
+ --with-tcl="$$TCL_BUILD_DIR" \
+ CFLAGS="$(CFLAGS)" \
+ CPPFLAGS="$(CPPFLAGS)" \
+ LDFLAGS="$(LDFLAGS)" \
+ CC="$(CC)") || exit $$?; \
+ fi; \
+ echo "Building extra package '$$extrapkg'"; \
+ (cd "$(EXTRA_BUILD_DIR)/$$extrapkg" && \
+ $(MAKE) \
+ TCL_LIBRARY=$(TCL_LIBRARY) \
+ CFLAGS="$(CFLAGS)" \
+ CPPFLAGS="$(CPPFLAGS)" \
+ LDFLAGS="$(LDFLAGS)" \
+ CC="$(CC)") || exit $$?; \
+ fi; \
+ done; \
+ else \
+ echo "No extra directory found at $(EXTRADIR) - skipping extra builds"; \
+ fi
+
+install-extra:
+ @if test -d "$(EXTRADIR)"; then \
+ for extradir in $(EXTRADIR)/*; do \
+ if test -d "$$extradir/unix" && test -f "$$extradir/unix/configure"; then \
+ extrapkg=`basename $$extradir`; \
+ if test -f "$(EXTRA_BUILD_DIR)/$$extrapkg/Makefile"; then \
+ echo "Installing extra package '$$extrapkg'"; \
+ (cd "$(EXTRA_BUILD_DIR)/$$extrapkg" && $(MAKE) install \
+ DESTDIR="$(INSTALL_ROOT)" \
+ prefix="$(prefix)" \
+ exec_prefix="$(exec_prefix)" \
+ TCL_LIBRARY=$(TCL_LIBRARY) \
+ CFLAGS="$(CFLAGS)" \
+ CPPFLAGS="$(CPPFLAGS)" \
+ LDFLAGS="$(LDFLAGS)" \
+ CC="$(CC)") || exit $$?; \
+ fi; \
+ fi; \
+ done; \
+ else \
+ echo "No extra directory found - skipping extra installs"; \
+ fi
+
+clean-extra:
+ @if test -d "$(EXTRA_BUILD_DIR)"; then \
+ for extrapkg in $(EXTRA_BUILD_DIR)/*; do \
+ if test -d "$$extrapkg" && test -f "$$extrapkg/Makefile"; then \
+ echo "Cleaning extra package in $$extrapkg"; \
+ (cd "$$extrapkg" && $(MAKE) clean) || exit $$?; \
+ fi; \
+ done; \
+ fi
+
+distclean-extra:
+ @if test -d "$(EXTRA_BUILD_DIR)"; then \
+ for extrapkg in $(EXTRA_BUILD_DIR)/*; do \
+ if test -d "$$extrapkg" && test -f "$$extrapkg/Makefile"; then \
+ echo "Distcleaning extra package in $$extrapkg"; \
+ (cd "$$extrapkg" && $(MAKE) distclean) || exit $$?; \
+ fi; \
+ rm -rf "$$extrapkg"; \
+ done; \
+ rm -rf "$(EXTRA_BUILD_DIR)"; \
+ fi
+
#--------------------------------------------------------------------------
# The list of all the targets that do not correspond to real files. This stops
# 'make' from getting confused when someone makes an error in a rule.
@@ -2166,6 +2251,7 @@ BUILD_HTML = \
.PHONY: install-tzdata install-msgs
.PHONY: packages configure-packages test-packages clean-packages
.PHONY: dist-packages distclean-packages install-packages
+.PHONY: extra install-extra clean-extra distclean-extra
#--------------------------------------------------------------------------
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/win/Makefile.in b/win/Makefile.in
index 8dd107670f..f0cf267329 100644
--- a/win/Makefile.in
+++ b/win/Makefile.in
@@ -129,6 +129,11 @@ ROOT_DIR_WIN_NATIVE = $(shell cd '$(ROOT_DIR)' ; pwd -W 2>/dev/null || pwd -P)
ZLIB_DIR_NATIVE = $(shell $(CYGPATH) '$(ZLIB_DIR)')
TOMMATH_DIR_NATIVE = $(shell $(CYGPATH) '$(TOMMATH_DIR)')
+# Tk-related directories (TKDIR can be set by user)
+TK_SRC_DIR = $(TKDIR)
+TK_BUILD_TOP = $(TKDIR)/win
+CONFIG_INSTALL_DIR = $(LIB_INSTALL_DIR)
+
# Fully qualify library path so that `make test`
# does not depend on the current directory.
LIBRARY_DIR1 = $(shell cd '$(ROOT_DIR_NATIVE)/library' ; pwd -P)
@@ -432,6 +437,34 @@ TCL_OBJS = ${GENERIC_OBJS} ${WIN_OBJS} @ZLIB_OBJS@ $(TOMMATH_OBJS)
TCL_DOCS = "$(ROOT_DIR_NATIVE)"/doc/*.[13n]
all: binaries libraries doc packages
+ @if test -n "$(TKDIR)" && test -d "$(TKDIR)"; then \
+ echo "TKDIR detected - automatically building Tk..."; \
+ echo "========== TK BUILD PARAMETERS =========="; \
+ echo "TKDIR=$(TKDIR)"; \
+ echo "TCLDIR=$(TOP_DIR)"; \
+ echo "prefix=$(prefix)"; \
+ echo "exec_prefix=$(exec_prefix)"; \
+ echo "TCL_TCLSH=$(BIN_INSTALL_DIR)/tclsh$(VER)${EXESUFFIX}"; \
+ echo "=========================================="; \
+ if test -f "$(TK_BUILD_TOP)/Makefile"; then \
+ echo "Building Tk using existing Makefile..."; \
+ (cd "$(TK_BUILD_TOP)" && $(MAKE)) || exit $$?; \
+ elif test -f "$(TK_SRC_DIR)/win/configure"; then \
+ echo "Configuring and building Tk..."; \
+ mkdir -p "$(TK_BUILD_TOP)"; \
+ (cd "$(TK_BUILD_TOP)" && \
+ "$(TK_SRC_DIR)/win/configure" \
+ --prefix="$(prefix)" \
+ --exec-prefix="$(exec_prefix)" \
+ --with-tcl="$(CONFIG_INSTALL_DIR)" && \
+ $(MAKE)) || exit $$?; \
+ else \
+ echo "ERROR: Tk configure script not found at $(TK_SRC_DIR)/win/configure"; \
+ exit 1; \
+ fi; \
+ else \
+ echo "TKDIR not set or directory does not exist - skipping Tk build"; \
+ fi
# Test-suite helper (can be used to test Tcl from build directory with all expected modules).
# To start from windows shell use:
@@ -648,6 +681,27 @@ gentommath_h:
> "$(GENERIC_DIR_NATIVE)/tclTomMath.h"
install: all install-binaries install-libraries install-doc install-packages
+ @if test -n "$(TKDIR)" && test -d "$(TKDIR)"; then \
+ echo "TKDIR detected - automatically installing Tk..."; \
+ echo "========== TK INSTALL PARAMETERS =========="; \
+ echo "TKDIR=$(TKDIR)"; \
+ echo "TCLDIR=$(TOP_DIR)"; \
+ echo "prefix=$(prefix)"; \
+ echo "exec_prefix=$(exec_prefix)"; \
+ echo "DESTDIR=$(INSTALL_ROOT)"; \
+ echo "TCL_TCLSH=$(BIN_INSTALL_DIR)/tclsh$(VER)${EXESUFFIX}"; \
+ echo "==========================================="; \
+ if test -f "$(TK_BUILD_TOP)/Makefile"; then \
+ echo "Installing Tk..."; \
+ (cd "$(TK_BUILD_TOP)" && $(MAKE) install DESTDIR="$(INSTALL_ROOT)") || exit $$?; \
+ else \
+ echo "ERROR: Tk Makefile not found at $(TK_BUILD_TOP)/Makefile"; \
+ echo "Please run 'make all' first to build Tk"; \
+ exit 1; \
+ fi; \
+ else \
+ echo "TKDIR not set or directory does not exist - skipping Tk install"; \
+ fi
install-binaries: binaries
@for i in "$(LIB_INSTALL_DIR)" "$(BIN_INSTALL_DIR)"; \
@@ -848,10 +902,24 @@ clean: cleanhelp clean-packages
$(RM) $(TCLSH) $(CAT32) $(TEST_EXE_FILE) $(TEST_DLL_FILE) tcltest.cmd tcltest.sh
$(RM) *.pch *.ilk *.pdb *.zip
$(RMDIR) *.vfs
+ @if test -n "$(TKDIR)" && test -d "$(TKDIR)" && test -f "$(TK_BUILD_TOP)/Makefile"; then \
+ echo "TKDIR detected - automatically cleaning Tk..."; \
+ echo "Cleaning Tk build..."; \
+ (cd "$(TK_BUILD_TOP)" && $(MAKE) clean) || exit $$?; \
+ else \
+ echo "TKDIR not set, directory does not exist, or no Tk build to clean"; \
+ fi
distclean: distclean-packages clean
$(RM) Makefile config.status config.cache config.log tclConfig.sh \
tcl.hpj config.status.lineno tclsh.exe.manifest tclUuid.h
+ @if test -n "$(TKDIR)" && test -d "$(TKDIR)" && test -f "$(TK_BUILD_TOP)/Makefile"; then \
+ echo "TKDIR detected - automatically distcleaning Tk..."; \
+ echo "Distcleaning Tk build..."; \
+ (cd "$(TK_BUILD_TOP)" && $(MAKE) distclean) || exit $$?; \
+ else \
+ echo "TKDIR not set, directory does not exist, or no Tk build to distclean"; \
+ fi
#
# Bundled package targets
diff --git a/win/makefile.vc b/win/makefile.vc
index c88c0ec3dc..cbdad89ba8 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -420,6 +420,7 @@ TCLSTUBOBJS = \
### the left side of implicit rules.
TOMMATHDIR = $(ROOT)\libtommath
PKGSDIR = $(ROOT)\pkgs
+WINDIR = $(ROOT)\win
# Additional include and C macro definitions for the implicit rules
# defined in rules.vc
@@ -438,6 +439,7 @@ TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT)
!endif
+
#---------------------------------------------------------------------
# Project specific targets
# There are 4 primary build configurations to consider from the combination
@@ -466,18 +468,24 @@ TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT)
# release - Everything that builds as part of a release
#---------------------------------------------------------------------
-release: setup $(TCLSH) $(TCLSTUBLIB) dlls pkgs
-all: setup $(TCLSH) $(TCLSTUBLIB) dlls $(CAT32) pkgs
+release: setup $(TCLSH) $(TCLSTUBLIB) dlls setpath pkgs tk-build
+all: setup $(TCLSH) $(TCLSTUBLIB) dlls $(CAT32) setpath pkgs
core: setup $(TCLLIB) $(TCLSTUBLIB)
shell: setup $(TCLSH)
dlls: setup $(TCLREGLIB) $(TCLDDELIB) $(OUT_DIR)\zlib1.dll
tcltest: setup $(TCLTEST) dlls $(CAT32)
-install: install-binaries install-libraries install-docs install-pkgs
+install: setpath install-binaries install-libraries install-docs install-pkgs tk-build tk-install
!if $(SYMBOLS)
install: install-pdbs
!endif
setup: default-setup
+# Add TCL win directory to PATH for current session
+setpath:
+ @echo Adding $(WINDIR) to PATH
+ @set PATH=$(WINDIR);$(PATH)
+ @echo PATH updated for current session
+
test: test-core test-pkgs
test-core: setup $(TCLTEST) dlls $(CAT32)
set TCL_LIBRARY=$(ROOT:\=/)/library
@@ -569,6 +577,84 @@ pkgs:
popd \
)
+tk-build:
+!if defined(TKDIR)
+ @echo TKDIR detected - building Tk...
+ @echo ========== TK BUILD PARAMETERS ==========
+ @echo TKDIR=$(TKDIR)
+ @echo TCLDIR=$(ROOT)
+!if defined(INSTALLDIR)
+ @echo INSTALLDIR=$(INSTALLDIR)
+!endif
+ @echo OPTS=$(OPTS)
+ @echo STATS=$(STATS)
+ @echo CHECKS=$(CHECKS)
+ @echo MACHINE=$(MACHINE)
+ @echo ==========================================
+ @if exist "$(TKDIR)\win\makefile.vc" ( \
+ pushd "$(TKDIR)\win" & \
+ $(MAKE) -$(MAKEFLAGS) -f makefile.vc TCLDIR=$(ROOT) OPTS=$(OPTS) STATS=$(STATS) CHECKS=$(CHECKS) MACHINE=$(MACHINE) & \
+ popd \
+ ) else ( \
+ echo ERROR: Tk makefile.vc not found at $(TKDIR)\win\makefile.vc & \
+ exit 1 \
+ )
+!else
+ @echo TKDIR not set or directory does not exist - skipping Tk build
+!endif
+
+tk-install:
+!if defined(TKDIR) && defined(INSTALLDIR)
+ @echo TKDIR detected - installing Tk...
+ @echo ========== TK INSTALL PARAMETERS ==========
+ @echo TKDIR=$(TKDIR)
+ @echo TCLDIR=$(ROOT)
+ @echo INSTALLDIR=$(INSTALLDIR)
+ @echo OPTS=$(OPTS)
+ @echo STATS=$(STATS)
+ @echo CHECKS=$(CHECKS)
+ @echo MACHINE=$(MACHINE)
+ @echo ===========================================
+ @if exist "$(TKDIR)\win\makefile.vc" ( \
+ pushd "$(TKDIR)\win" & \
+ $(MAKE) -$(MAKEFLAGS) -f makefile.vc TCLDIR=$(ROOT) INSTALLDIR=$(INSTALLDIR) OPTS=$(OPTS) STATS=$(STATS) CHECKS=$(CHECKS) MACHINE=$(MACHINE) install & \
+ popd \
+ ) else ( \
+ echo ERROR: Tk makefile.vc not found at $(TKDIR)\win\makefile.vc & \
+ exit 1 \
+ )
+!else
+ @echo TKDIR not set, INSTALLDIR not set, or directory does not exist - skipping Tk install
+!endif
+
+tk-clean:
+!if defined(TKDIR)
+ @echo TKDIR detected - cleaning Tk build...
+ @if exist "$(TKDIR)\win\makefile.vc" ( \
+ pushd "$(TKDIR)\win" & \
+ $(MAKE) -$(MAKEFLAGS) -f makefile.vc TCLDIR=$(ROOT) clean & \
+ popd \
+ ) else ( \
+ echo No Tk makefile found to clean \
+ )
+!else
+ @echo TKDIR not set or directory does not exist - skipping Tk clean
+!endif
+
+tk-distclean:
+!if defined(TKDIR)
+ @echo TKDIR detected - distcleaning Tk build...
+ @if exist "$(TKDIR)\win\makefile.vc" ( \
+ pushd "$(TKDIR)\win" & \
+ $(MAKE) -$(MAKEFLAGS) -f makefile.vc TCLDIR=$(ROOT) distclean & \
+ popd \
+ ) else ( \
+ echo No Tk makefile found to distclean \
+ )
+!else
+ @echo TKDIR not set or directory does not exist - skipping Tk distclean
+!endif
+
test-pkgs:
@for /d %d in ($(PKGSDIR)\*) do \
@if exist "%~fd\win\makefile.vc" ( \
@@ -1058,8 +1144,8 @@ tidy:
@echo Removing $(TCLREGLIB) ...
@if exist $(TCLREGLIB) del $(TCLREGLIB)
-clean: default-clean clean-pkgs
-hose: default-hose hose-pkgs
+clean: default-clean clean-pkgs tk-clean
+hose: default-hose hose-pkgs tk-distclean
realclean: hose
.PHONY:
--
2.43.0

View File

@@ -1,27 +0,0 @@
From 85842ba83b70d99f90ee3fff8c956e82d17759f2 Mon Sep 17 00:00:00 2001
From: Marek Roszko <mark.roszko@gmail.com>
Date: Tue, 18 Aug 2020 23:11:27 -0400
Subject: [PATCH] Remove broken exist check for shell install
---
win/makefile.vc | 2 --
1 file changed, 2 deletions(-)
diff --git a/win/makefile.vc b/win/makefile.vc
index f5d2f4a..6bffe32 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -869,10 +869,8 @@ install-binaries:
@$(CPY) "$(TCLLIB)" "$(BIN_INSTALL_DIR)\"
!endif
@$(CPY) "$(TCLIMPLIB)" "$(LIB_INSTALL_DIR)\"
-!if exist($(TCLSH))
@echo Installing $(TCLSHNAME)
@$(CPY) "$(TCLSH)" "$(BIN_INSTALL_DIR)\"
-!endif
@echo Installing $(TCLSTUBLIBNAME)
@$(CPY) "$(TCLSTUBLIB)" "$(LIB_INSTALL_DIR)\"
--
2.28.0.windows.1

View File

@@ -1,20 +1,55 @@
vcpkg_from_sourceforge(
OUT_SOURCE_PATH SOURCE_PATH
REPO tcl/Tcl
REF 8.6.15
FILENAME tcl8.6.15-src.tar.gz
SHA512 9ae652823084899091467744da5a35d0fdfb453c055baea96af1bb181d161abe58b83382315cc3abee5fd57acc4ad5028df486a3e53645a28d1467e9c8d1d23e
REF 8.6.16
FILENAME tcl8.6.16-src.tar.gz
SHA512 434c92f8181fb8dca6bc065b0f1f5078779086f19adf008818c90a3108596c63465ef43e9f3c1cfb3d4151a9de244d0bf0e6ee5b40e714b1ddca4a78eb43050b
PATCHES
0001-Support-Tk.patch
)
if (VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_TARGET_ARCHITECTURE MATCHES "x64")
set(USE_TCL_TK OFF)
set (TKDIR_WIN "")
if ("tk" IN_LIST FEATURES)
set (TKDIR_WIN "TKDIR=../extra/tk.8.6.16-src")
vcpkg_from_sourceforge(
OUT_SOURCE_PATH TK_SOURCE_PATH
REPO tcl/Tcl
REF 8.6.16
FILENAME tk8.6.16-src.tar.gz
SHA512 b7d37bee25f826f156137a04859ac756c682f1dd155ec9629119dc3690509ce1b6e308e23b291f2debbc10f3b1650993fea66463e5445c505860a10acac901d0
)
# Copy TK to TCL package source path (SOURCE_PATH/extra/tk) if TK is used
if (NOT EXISTS "${SOURCE_PATH}/extra/tk.8.6.16-src")
file(MAKE_DIRECTORY "${SOURCE_PATH}/extra/tk.8.6.16-src")
file(COPY ${TK_SOURCE_PATH}/ DESTINATION "${SOURCE_PATH}/extra/tk.8.6.16-src")
endif()
set (USE_TCL_TK ON)
endif()
# Copy TK to TCL package source path if TK is used
# Use Windows NMAKE build for MSVC, but Unix build for MinGW
if (VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
if(VCPKG_TARGET_ARCHITECTURE MATCHES "x64")
set(TCL_BUILD_MACHINE_STR MACHINE=AMD64)
else()
set(TCL_BUILD_ARCH_STR ARCH=AMD64)
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "arm")
set(TCL_BUILD_MACHINE_STR MACHINE=ARM64)
set(TCL_BUILD_ARCH_STR ARCH=ARM64)
elseif(VCPKG_TARGET_ARCHITECTURE MATCHES "x86")
set(TCL_BUILD_MACHINE_STR MACHINE=IX86)
set(TCL_BUILD_ARCH_STR ARCH=IX86)
else()
# Default fallback for unknown architectures
set(TCL_BUILD_MACHINE_STR MACHINE=IX86)
set(TCL_BUILD_ARCH_STR ARCH=IX86)
endif()
# Handle features
set(TCL_BUILD_OPTS OPTS=pdbs)
set(TCL_BUILD_OPTS OPTS=)
set(TCL_BUILD_STATS STATS=none)
set(TCL_BUILD_CHECKS CHECKS=none)
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
@@ -42,109 +77,57 @@ if (VCPKG_TARGET_IS_WINDOWS)
PROJECT_SUBPATH win
OPTIONS
${TCL_BUILD_MACHINE_STR}
${TCL_BUILD_ARCH_STR}
${TCL_BUILD_STATS}
${TCL_BUILD_CHECKS}
${TKDIR_WIN}
OPTIONS_DEBUG
${TCL_BUILD_OPTS},symbols
${TCL_BUILD_OPTS},symbols,pdbs
INSTALLDIR=${CURRENT_PACKAGES_DIR}/debug
SCRIPT_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/tools/tcl/debug/lib/tcl9.0
OPTIONS_RELEASE
release
${TCL_BUILD_OPTS}
INSTALLDIR=${CURRENT_PACKAGES_DIR}
SCRIPT_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/tools/tcl/lib/tcl9.0
)
# Install
# Note: tcl shell requires it to be in a folder adjacent to the /lib/ folder, i.e. in a /bin/ folder
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release)
file(GLOB_RECURSE TOOL_BIN
"${CURRENT_PACKAGES_DIR}/bin/*.exe"
"${CURRENT_PACKAGES_DIR}/bin/*.dll"
)
file(COPY ${TOOL_BIN} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/tcl/bin/")
# Remove .exes only after copying
file(GLOB_RECURSE TOOL_EXES
${CURRENT_PACKAGES_DIR}/bin/*.exe
)
file(REMOVE ${TOOL_EXES})
file(GLOB_RECURSE TOOLS
"${CURRENT_PACKAGES_DIR}/lib/dde1.4/*"
"${CURRENT_PACKAGES_DIR}/lib/nmake/*"
"${CURRENT_PACKAGES_DIR}/lib/reg1.3/*"
"${CURRENT_PACKAGES_DIR}/lib/tcl8/*"
"${CURRENT_PACKAGES_DIR}/lib/tcl8.6/*"
"${CURRENT_PACKAGES_DIR}/lib/tdbcsqlite31.1.0/*"
)
foreach(TOOL ${TOOLS})
get_filename_component(DST_DIR ${TOOL} PATH)
file(COPY "${TOOL}" DESTINATION ${DST_DIR})
endforeach()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/dde1.4"
"${CURRENT_PACKAGES_DIR}/lib/nmake"
"${CURRENT_PACKAGES_DIR}/lib/reg1.3"
"${CURRENT_PACKAGES_DIR}/lib/tcl8"
"${CURRENT_PACKAGES_DIR}/lib/tcl8.6"
"${CURRENT_PACKAGES_DIR}/lib/tdbcsqlite31.1.0"
)
file(CHMOD_RECURSE
"${CURRENT_PACKAGES_DIR}/tools/tcl/lib/tcl9.0/msgs" "${CURRENT_PACKAGES_DIR}/tools/tcl/lib/tcl9.0/tzdata"
PERMISSIONS
OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ WORLD_WRITE
)
endif()
if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug)
file(GLOB_RECURSE TOOL_BIN
"${CURRENT_PACKAGES_DIR}/debug/bin/*.exe"
"${CURRENT_PACKAGES_DIR}/debug/bin/*.dll"
)
file(COPY ${TOOL_BIN} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/tcl/debug/bin/")
# Remove .exes only after copying
file(GLOB_RECURSE EXES
"${CURRENT_PACKAGES_DIR}/debug/bin/*.exe"
)
file(REMOVE ${EXES})
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/dde1.4"
"${CURRENT_PACKAGES_DIR}/debug/lib/nmake"
"${CURRENT_PACKAGES_DIR}/debug/lib/reg1.3"
"${CURRENT_PACKAGES_DIR}/debug/lib/tcl8"
"${CURRENT_PACKAGES_DIR}/debug/lib/tcl8.6"
"${CURRENT_PACKAGES_DIR}/debug/lib/tdbcsqlite31.1.0"
)
file(CHMOD_RECURSE
"${CURRENT_PACKAGES_DIR}/tools/tcl/debug/lib/tcl9.0/msgs" "${CURRENT_PACKAGES_DIR}/tools/tcl/debug/lib/tcl9.0/tzdata"
PERMISSIONS
OWNER_READ OWNER_WRITE
GROUP_READ GROUP_WRITE
WORLD_READ WORLD_WRITE
)
endif()
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file (REMOVE ${CURRENT_PACKAGES_DIR}/bin/zlib1.dll)
file (REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/zlib1.dll)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
else()
set (TCL_PROJECT_SUBPATH unix)
if (VCPKG_TARGET_IS_MINGW)
set (TCL_PROJECT_SUBPATH win)
endif()
# file(REMOVE "${SOURCE_PATH}/${TCL_PROJECT_SUBPATH}/configure")
# For MinGW and other Unix-like environments on Windows, use unix build path
# MinGW can use either win/ (with MinGW-compatible Makefiles) or unix/ (with autotools)
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
PROJECT_SUBPATH unix
PROJECT_SUBPATH ${TCL_PROJECT_SUBPATH}
AUTOCONFIG
)
vcpkg_install_make()
# Build with explicit X11 paths for Tk when needed
if(USE_TCL_TK AND NOT VCPKG_TARGET_IS_WINDOWS)
vcpkg_build_make(
ENVIRONMENT
"CPPFLAGS=-I${CURRENT_INSTALLED_DIR}/include"
"LDFLAGS=-L${CURRENT_INSTALLED_DIR}/lib"
)
vcpkg_install_make(
ENVIRONMENT
"CPPFLAGS=-I${CURRENT_INSTALLED_DIR}/include"
"LDFLAGS=-L${CURRENT_INSTALLED_DIR}/lib"
)
else()
vcpkg_install_make()
endif()
vcpkg_fixup_pkgconfig()
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
@@ -153,4 +136,9 @@ endif()
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/tclConfig.sh" "${CURRENT_PACKAGES_DIR}/debug/lib/tclConfig.sh")
# Remove TK configuration files if TK was built
if(USE_TCL_TK)
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/tkConfig.sh" "${CURRENT_PACKAGES_DIR}/debug/lib/tkConfig.sh")
endif()
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/license.terms")

View File

@@ -20,6 +20,9 @@
},
"utfmax": {
"description": "Forces Tcl_UniChar to be a 32-bit quantity in stead of 16-bits"
},
"tk" : {
"description": "Enables optional usage of Tk. Part of the module-foundation-classes."
}
}
}

View File

@@ -0,0 +1,9 @@
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
set(VCPKG_FIXUP_ELF_RPATH ON)
set(VCPKG_BUILD_TYPE "release")

View File

@@ -14,5 +14,8 @@
],
"overlay-ports": [
"./ports"
]
}
],
"overlay-triplets": [
"./triplets"
]
}

View File

@@ -26,7 +26,7 @@
},
{
"name": "angle",
"platform": "uwp"
"platform": "uwp"
},
{
"name": "opengl",
@@ -35,9 +35,12 @@
],
"features": {
"angle": {
"description": "Enables optional usage of ANGLE. Part of the module-visualization.",
"description": "Enables optional usage of OpenGL ES 2.0. Part of the module-visualization.",
"dependencies": [
"angle"
{
"name": "angle",
"platform": "!(linux & !static)"
}
]
},
"opengl": {
@@ -52,6 +55,21 @@
"tcl"
]
},
"tcltk": {
"description": "Enables optional usage of TclTk. Part of the module-foundation-classes.",
"dependencies": [
{
"name": "tcl",
"features": [
"tk"
]
},
{
"name": "libx11",
"platform": "!windows"
}
]
},
"freeimage": {
"description": "Enables optional usage of FreeImage. Part of the module-visualization.",
"dependencies": [

View File

@@ -118,7 +118,7 @@ The following table gives the full list of environment variables used at the con
| BUILD_INCLUDE_SYMLINK | Boolean | Use symbolic links instead of copies for header files in build directory |
| BUILD_MODULE_<MODULE>| Boolean | Indicates whether the corresponding OCCT module should be built |
| BUILD_LIBRARY_TYPE | String | Specifies library type ("Shared" or "Static") |
| BUILD_CPP_STANDARD | String | Select C++ standard (C++11, C++14, C++17, C++20, C++23) |
| BUILD_CPP_STANDARD | String | Select C++ standard (C++17, C++20, C++23, C++26) |
| 3RDPARTY_DIR | Path | Defines the root directory where all required 3rd party products will be searched. Once you define this path it is very convenient to click "Configure" button in order to let CMake automatically detect all necessary products|
| 3RDPARTY_FREETYPE_* | Path | Path to FreeType binaries |
| 3RDPARTY_TCL_* 3RDPARTY_TK_* | Path | Path to Tcl/Tk binaries |

View File

@@ -28,6 +28,9 @@ if { [info exists env(DRAWHOME) ] } {
} else {
if { [info exists env(CASROOT) ] } {
set dir [file join $env(CASROOT) src DrawResources]
if { ! [file isdirectory $dir] } {
set dir [file join $env(CASROOT) resources DrawResources]
}
} else {
puts "Warning: CASROOT is not defined, some features may not load correctly"
set dir [file dirname [info script]]

View File

@@ -79,6 +79,9 @@
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">obj\$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
</PropertyGroup>
<PropertyGroup>
<LanguageStandard>stdcpp17</LanguageStandard>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>

View File

@@ -80,6 +80,9 @@
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">obj\$(Platform)\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
</PropertyGroup>
<PropertyGroup>
<LanguageStandard>stdcpp17</LanguageStandard>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>

View File

@@ -90,4 +90,7 @@ include_directories (${CMAKE_BINARY_DIR}/inc
${Geometry_RESOURCE_DIR}
${MFC_STANDARD_SAMPLES_DIR}/Common)
target_link_libraries (Geometry mfcsample)
target_link_libraries (Geometry mfcsample)
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)

View File

@@ -577,4 +577,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<PropertyGroup>
<LanguageStandard>stdcpp17</LanguageStandard>
</PropertyGroup>
</Project>

View File

@@ -62,3 +62,6 @@ include_directories (${CMAKE_BINARY_DIR}/inc
${MFC_STANDARD_SAMPLES_DIR}/Common)
target_link_libraries (Modeling mfcsample TKDESTEP TKBO)
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)

View File

@@ -83,6 +83,9 @@
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\win64\obj\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
</PropertyGroup>
<PropertyGroup>
<LanguageStandard>stdcpp17</LanguageStandard>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Midl>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>

View File

@@ -59,4 +59,7 @@ include_directories (${CMAKE_BINARY_DIR}/inc
${ImportExport_SRC_DIR}
${MFC_STANDARD_SAMPLES_DIR}/Common)
target_link_libraries (ImportExport mfcsample)
target_link_libraries (ImportExport mfcsample)
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)

View File

@@ -353,4 +353,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<PropertyGroup>
<LanguageStandard>stdcpp17</LanguageStandard>
</PropertyGroup>
</Project>

View File

@@ -85,4 +85,7 @@ include_directories (${CMAKE_BINARY_DIR}/inc
${HLR_SRC_DIR}
${MFC_STANDARD_SAMPLES_DIR}/Common)
target_link_libraries (HLR mfcsample)
target_link_libraries (HLR mfcsample)
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)

View File

@@ -410,4 +410,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<PropertyGroup>
<LanguageStandard>stdcpp17</LanguageStandard>
</PropertyGroup>
</Project>

View File

@@ -187,3 +187,6 @@ set (mfcsample_USED_LIBS TKDEVRML
${CSF_OpenGlLibs})
target_link_libraries (mfcsample ${mfcsample_USED_LIBS})
set (CMAKE_CXX_STANDARD 17)
set (CMAKE_CXX_STANDARD_REQUIRED ON)

View File

@@ -699,4 +699,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
<PropertyGroup>
<LanguageStandard>stdcpp17</LanguageStandard>
</PropertyGroup>
</Project>

View File

@@ -15,11 +15,12 @@ occt_lib_path = $$_PRO_FILE_PWD_/occt/$$occt_lib_subpath
android {
QMAKE_CFLAGS += -fexceptions -Wno-ignored-qualifiers
QMAKE_CXXFLAGS += -fexceptions -Wno-ignored-qualifiers
QMAKE_CXXFLAGS += -fexceptions -Wno-ignored-qualifiers -std=c++17
LIBS += -L$$occt_lib_path -lEGL
}
win32 {
QMAKE_CXXFLAGS_WARN_ON += -W4
QMAKE_CXXFLAGS += /std:c++17
INCLUDEPATH += $$(CSF_OCCTIncludePath)
LIBS += -L$(CSF_OCCTLibPath);$(CSF_PRODLibPath)
LIBS += -lopengl32

View File

@@ -42,7 +42,7 @@ unix {
equals(MACOSX_USE_GLX, true): DEFINES += MACOSX_USE_GLX
DEFINES += OCC_CONVERT_SIGNALS QT_NO_STL
!macx | equals(MACOSX_USE_GLX, true): LIBS += -L$$QMAKE_LIBDIR_X11 $$QMAKE_LIBS_X11 -L$$QMAKE_LIBDIR_OPENGL $$QMAKE_LIBS_OPENGL $$QMAKE_LIBS_THREAD
QMAKE_CXXFLAGS += -std=gnu++11
QMAKE_CXXFLAGS += -std=c++17
}
win32 {
@@ -57,6 +57,7 @@ win32 {
OBJECTS_DIR = ./win$$(ARCH)/$$(VCVER)/obj
MOC_DIR = ./src
}
QMAKE_CXXFLAGS += /std:c++17
LIBS = -L$$(QTDIR)/lib;$$(CSF_OCCTLibPath)
}

View File

@@ -56,7 +56,7 @@ unix {
!macx | equals(MACOSX_USE_GLX, true): LIBS += -L$$QMAKE_LIBDIR_X11 $$QMAKE_LIBS_X11 -L$$QMAKE_LIBDIR_OPENGL $$QMAKE_LIBS_OPENGL $$QMAKE_LIBS_THREAD
LIBS += -lfreeimageplus
LIBS += -ltbb -ltbbmalloc
QMAKE_CXXFLAGS += -std=gnu++11
QMAKE_CXXFLAGS += -std=c++17
}
win32 {
@@ -71,6 +71,7 @@ win32 {
OBJECTS_DIR = ./win$$(ARCH)/$$(VCVER)/obj
MOC_DIR = ./win$$(ARCH)/$$(VCVER)/moc
}
QMAKE_CXXFLAGS += /std:c++17
LIBS = -L$$(QTDIR)/lib;$$(CSF_OCCTLibPath)
DEFINES += NO_COMMONSAMPLE_EXPORTS NO_IESAMPLE_EXPORTS
}

View File

@@ -59,7 +59,7 @@ unix {
DEFINES += OCC_CONVERT_SIGNALS QT_NO_STL
!macx | equals(MACOSX_USE_GLX, true): LIBS += -L$$QMAKE_LIBDIR_X11 $$QMAKE_LIBS_X11 -L$$QMAKE_LIBDIR_OPENGL $$QMAKE_LIBS_OPENGL $$QMAKE_LIBS_THREAD
QMAKE_CXXFLAGS += -std=gnu++11
QMAKE_CXXFLAGS += -std=c++17
}
win32 {
@@ -74,6 +74,7 @@ win32 {
OBJECTS_DIR = ./win$$(ARCH)/$$(VCVER)/obj
MOC_DIR = ./win$$(ARCH)/$$(VCVER)/moc
}
QMAKE_CXXFLAGS += /std:c++17
LIBS = -L$$(QTDIR)/lib;$$(CSF_OCCTLibPath)
DEFINES += NO_COMMONSAMPLE_EXPORTS NO_IESAMPLE_EXPORTS
}

View File

@@ -57,7 +57,7 @@ unix {
equals(MACOSX_USE_GLX, true): DEFINES += MACOSX_USE_GLX
DEFINES += OCC_CONVERT_SIGNALS QT_NO_STL
!macx | equals(MACOSX_USE_GLX, true): LIBS += -L$$QMAKE_LIBDIR_X11 $$QMAKE_LIBS_X11 -L$$QMAKE_LIBDIR_OPENGL $$QMAKE_LIBS_OPENGL $$QMAKE_LIBS_THREAD
QMAKE_CXXFLAGS += -std=gnu++11
QMAKE_CXXFLAGS += -std=c++17
}
win32 {
@@ -73,6 +73,7 @@ win32 {
MOC_DIR = ./win$$(ARCH)/$$(VCVER)/moc
}
LIBS = -L$$(QTDIR)/lib;$$(CSF_OCCTLibPath)
QMAKE_CXXFLAGS += /std:c++17
DEFINES += NO_COMMONSAMPLE_EXPORTS NO_IESAMPLE_EXPORTS
}

View File

@@ -33,10 +33,8 @@
static Standard_GUID BinStorageDriver("03a56835-8269-11d5-aab2-0050044b1af1");
static Standard_GUID BinRetrievalDriver("03a56836-8269-11d5-aab2-0050044b1af1");
//=======================================================================
// function : Factory
// purpose : PLUGIN FACTORY
//=======================================================================
//=================================================================================================
const Handle(Standard_Transient)& BinDrivers::Factory(const Standard_GUID& theGUID)
{
if (theGUID == BinStorageDriver)

View File

@@ -31,10 +31,8 @@
static Standard_GUID BinLStorageDriver("13a56835-8269-11d5-aab2-0050044b1af1");
static Standard_GUID BinLRetrievalDriver("13a56836-8269-11d5-aab2-0050044b1af1");
//=======================================================================
// function : Factory
// purpose : PLUGIN FACTORY
//=======================================================================
//=================================================================================================
const Handle(Standard_Transient)& BinLDrivers::Factory(const Standard_GUID& theGUID)
{
if (theGUID == BinLStorageDriver)

View File

@@ -17,10 +17,7 @@
#include <TDocStd_FormatVersion.hxx>
#include <BinMDataStd.hxx>
//=======================================================================
// function : BinLDrivers_DocumentSection
// purpose : Empty constructor
//=======================================================================
//=================================================================================================
BinLDrivers_DocumentSection::BinLDrivers_DocumentSection()
: myIsPostRead(Standard_False)
@@ -106,7 +103,7 @@ void BinLDrivers_DocumentSection::WriteTOC(Standard_OStream& theStream
if (aBufSize < aLen)
aBufSize += sizeof(Standard_Integer);
// Write the buffer: size + string
// Write the buffer: size + string
#ifdef DO_INVERSE
aBufSz[0] = InverseInt((Standard_Integer)aBufSize);
#else

View File

@@ -39,10 +39,7 @@ typedef struct
unsigned char Data4[8]; // 8-bytes long on all OS
} BinObjMgt_UUID;
//=======================================================================
// function : BinObjMgt_Persistent
// purpose : Empty constructor
//=======================================================================
//=================================================================================================
BinObjMgt_Persistent::BinObjMgt_Persistent()
: myIndex(1),

Some files were not shown because too many files have changed in this diff Show More