diff --git a/.github/workflows/CPPBuild.yml b/.github/workflows/CPPBuild.yml index 516c88fc5..308a09a26 100644 --- a/.github/workflows/CPPBuild.yml +++ b/.github/workflows/CPPBuild.yml @@ -42,15 +42,44 @@ jobs: sudo apt-get install zlib1g-dev sudo apt-get install libkrb5-dev + - name: 'Setup MSVC environment' + if: ${{ matrix.os == 'windows-latest' }} + uses: ilammy/msvc-dev-cmd@v1 + - name: 'Building the library into native for Windows' if: ${{ matrix.os == 'windows-latest' }} shell: cmd run: | cd Sources/Wrappers/AngouriMath.CPP.Exporting mkdir ../AngouriMath.CPP.Importing/out-x64 - call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvars64.bat" dotnet publish -p:NativeLib=Shared -p:SelfContained=true -p:PublishAot=true -r ${{ matrix.flag }} -c release + - name: 'Debug: List files in out-x64 for Windows' + if: ${{ matrix.os == 'windows-latest' }} + shell: cmd + run: | + cd Sources/Wrappers/AngouriMath.CPP.Importing/out-x64 + dir + cd ..\..\AngouriMath.CPP.Exporting\bin\Release\net10.0\win-x64 + echo. + echo Listing bin directory: + dir *.lib + dir *.dll + + - name: 'Generate .lib file for Windows' + if: ${{ matrix.os == 'windows-latest' }} + shell: cmd + run: | + cd Sources/Wrappers/AngouriMath.CPP.Importing/out-x64 + echo Checking for dumpbin and lib... + where dumpbin + where lib + dumpbin /exports AngouriMath.CPP.Exporting.dll > exports.txt + echo LIBRARY AngouriMath.CPP.Exporting > AngouriMath.CPP.Exporting.def + echo EXPORTS >> AngouriMath.CPP.Exporting.def + for /f "skip=19 tokens=4" %%A in (exports.txt) do if not "%%A"=="" echo %%A >> AngouriMath.CPP.Exporting.def + lib /def:AngouriMath.CPP.Exporting.def /out:AngouriMath.CPP.Exporting.lib /machine:x64 + - name: 'Building the library into native for Linux & MacOS' if: ${{ matrix.os != 'windows-latest' }} run: | @@ -62,12 +91,14 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest' }} run: | cd Sources/Wrappers/AngouriMath.CPP.Importing/out-x64 + ls -la mv AngouriMath.CPP.Exporting.so libAngouriMath.CPP.Exporting.so - name: 'Renaming the library for OS X' if: ${{ matrix.os == 'macos-latest' }} run: | cd Sources/Wrappers/AngouriMath.CPP.Importing/out-x64 + ls -la mv AngouriMath.CPP.Exporting.dylib libAngouriMath.CPP.Exporting.dylib install_name_tool -id "@rpath/libAngouriMath.CPP.Exporting.dylib" libAngouriMath.CPP.Exporting.dylib diff --git a/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj b/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj index 4069216ab..6643a6a5c 100644 --- a/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj +++ b/Sources/Wrappers/AngouriMath.CPP.Exporting/AngouriMath.CPP.Exporting.csproj @@ -6,6 +6,8 @@ true true + true + false