-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix missing include in fraction.h, update CPM version, add windows bu…
…ild using mingw compilers
- Loading branch information
1 parent
5b024ea
commit 576eb5d
Showing
6 changed files
with
132 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,24 @@ | ||
set(CPM_DOWNLOAD_VERSION 0.38.6) | ||
# SPDX-License-Identifier: MIT | ||
# | ||
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 Lars Melchior and contributors | ||
|
||
set(CPM_DOWNLOAD_VERSION 0.40.2) | ||
set(CPM_HASH_SUM "c8cdc32c03816538ce22781ed72964dc864b2a34a310d3b7104812a5ca2d835d") | ||
|
||
if(CPM_SOURCE_CACHE) | ||
# Expand relative path. This is important if the provided path contains a tilde (~) | ||
get_filename_component(CPM_SOURCE_CACHE ${CPM_SOURCE_CACHE} ABSOLUTE) | ||
set(CPM_DOWNLOAD_LOCATION "${CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") | ||
elseif(DEFINED ENV{CPM_SOURCE_CACHE}) | ||
set(CPM_DOWNLOAD_LOCATION "$ENV{CPM_SOURCE_CACHE}/cpm/CPM_${CPM_DOWNLOAD_VERSION}.cmake") | ||
else() | ||
set(CPM_DOWNLOAD_LOCATION "${CMAKE_BINARY_DIR}/cmake/CPM_${CPM_DOWNLOAD_VERSION}.cmake") | ||
endif() | ||
|
||
if(NOT (EXISTS ${CPM_DOWNLOAD_LOCATION})) | ||
message(STATUS "Downloading CPM.cmake to ${CPM_DOWNLOAD_LOCATION}") | ||
file(DOWNLOAD | ||
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake | ||
${CPM_DOWNLOAD_LOCATION} | ||
) | ||
endif() | ||
# Expand relative path. This is important if the provided path contains a tilde (~) | ||
get_filename_component(CPM_DOWNLOAD_LOCATION ${CPM_DOWNLOAD_LOCATION} ABSOLUTE) | ||
|
||
file(DOWNLOAD | ||
https://github.com/cpm-cmake/CPM.cmake/releases/download/v${CPM_DOWNLOAD_VERSION}/CPM.cmake | ||
${CPM_DOWNLOAD_LOCATION} EXPECTED_HASH SHA256=${CPM_HASH_SUM} | ||
) | ||
|
||
include(${CPM_DOWNLOAD_LOCATION}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#pragma once | ||
#include <numeric> | ||
#include <cstdint> | ||
#include <string> | ||
|
||
namespace occ::core { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
param( | ||
[Parameter(Mandatory=$true)] | ||
[string]$ExecutablePath | ||
) | ||
|
||
function Check-StaticBinary { | ||
param( | ||
[string]$ExePath | ||
) | ||
|
||
if (-not (Test-Path $ExePath)) { | ||
Write-Error "Executable not found at $ExePath" | ||
return | ||
} | ||
|
||
Write-Output "Checking if the binary is static: $ExePath" | ||
|
||
try { | ||
$dependencies = & objdump -p $ExePath | Select-String "DLL Name" | ||
|
||
if ($dependencies) { | ||
Write-Output "The following dependencies were found:" | ||
$dependencies | ForEach-Object { Write-Output $_.Line } | ||
Write-Output "The binary might not be fully static." | ||
} else { | ||
Write-Output "No DLL dependencies found. The binary appears to be static." | ||
} | ||
} | ||
catch { | ||
Write-Error "Error occurred while running objdump: $_" | ||
} | ||
} | ||
|
||
# Run the function with the provided executable path | ||
Check-StaticBinary -ExePath $ExecutablePath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
$BUILD_DIR = "build" | ||
$ARCH = "x86_64" | ||
$NAME = "windows" | ||
|
||
# Override architecture if provided as argument | ||
if ($args.Count -gt 0) { | ||
$ARCH = $args[0] | ||
} | ||
if ($args.Count -gt 1) { | ||
$NAME = $args[1] | ||
} | ||
|
||
# Ensure GCC (MinGW-w64) is installed and in PATH | ||
if (!(Get-Command gcc -ErrorAction SilentlyContinue)) { | ||
Write-Error "GCC not found. Please install MinGW-w64 and add it to your PATH." | ||
exit 1 | ||
} | ||
|
||
# Ensure Ninja is installed and in PATH | ||
if (!(Get-Command ninja -ErrorAction SilentlyContinue)) { | ||
Write-Error "Ninja not found. Please install Ninja and add it to your PATH." | ||
exit 1 | ||
} | ||
|
||
# Get GCC path | ||
$GCC_PATH = (Get-Command gcc).Source | ||
$GPP_PATH = (Get-Command g++).Source | ||
|
||
# Create build directory if it doesn't exist | ||
if (!(Test-Path $BUILD_DIR)) { | ||
New-Item -ItemType Directory -Force -Path $BUILD_DIR | ||
} | ||
|
||
# Run CMake configuration | ||
cmake . -B"$BUILD_DIR" ` | ||
-DCMAKE_BUILD_TYPE=Release ` | ||
-DENABLE_HOST_OPT=OFF ` | ||
-GNinja ` | ||
-DCMAKE_C_COMPILER="$GCC_PATH" ` | ||
-DCMAKE_CXX_COMPILER="$GPP_PATH" ` | ||
-DCMAKE_CXX_FLAGS="-O2" ` | ||
-DCMAKE_C_FLAGS="-O2" ` | ||
-DUSE_OPENMP=OFF ` | ||
-DCPACK_SYSTEM_NAME="$NAME" ` | ||
-DGG_NO_PRAGMA=ON | ||
|
||
if ($LASTEXITCODE -ne 0) { | ||
Write-Error "CMake configuration failed." | ||
exit $LASTEXITCODE | ||
} | ||
|
||
# Build the project | ||
cmake --build "$BUILD_DIR" --target occ | ||
|
||
if ($LASTEXITCODE -ne 0) { | ||
Write-Error "Build failed." | ||
exit $LASTEXITCODE | ||
} | ||
|
||
# Package the project | ||
Push-Location $BUILD_DIR | ||
cpack -G ZIP | ||
if ($LASTEXITCODE -ne 0) { | ||
Write-Error "Packaging failed." | ||
exit $LASTEXITCODE | ||
} | ||
Pop-Location | ||
|
||
Write-Output "Build and packaging completed successfully." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters