diff --git a/.github/workflows/set_vars_windows.bat b/.github/workflows/set_vars_windows.bat new file mode 100644 index 00000000..03f13f27 --- /dev/null +++ b/.github/workflows/set_vars_windows.bat @@ -0,0 +1,22 @@ +REM SPDX-FileCopyrightText: 2022 Intel Corporation +REM +REM SPDX-License-Identifier: MIT + +set LANGUAGE=%1 +set VS_VER=%2 +set SAMPLES_TAG=%3 + +IF "%VS_VER%"=="2017_build_tools" ( + @call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvars64.bat" +) ELSE ( + IF "%VS_VER%"=="2019_build_tools" ( + @call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat" + ) ELSE ( + @call "C:\Program Files (x86)\Intel\oneAPI\setvars-vcvarsall.bat" %VS_VER% + ) +) + +for /f "tokens=* usebackq" %%f in (`dir /b "C:\Program Files (x86)\Intel\oneAPI\compiler\" ^| findstr /V latest ^| sort`) do @set "LATEST_VERSION=%%f" +@call "C:\Program Files (x86)\Intel\oneAPI\compiler\%LATEST_VERSION%\env\vars.bat" + +exit /b %RESULT% diff --git a/.github/workflows/windows-intelLLVM.yml b/.github/workflows/windows-intelLLVM.yml index 85a0fb40..32e0228a 100644 --- a/.github/workflows/windows-intelLLVM.yml +++ b/.github/workflows/windows-intelLLVM.yml @@ -48,12 +48,9 @@ jobs: - name: Setup ninja uses: seanmiddleditch/gha-setup-ninja@master - - name: Setup upterm session - uses: lhotari/action-upterm@v1 - - name: CMake build run: | - C:\Program Files (x86)\Intel\oneAPI\setvars-vcvarsall.bat + call .github\workflows\set_vars_windows.bat cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCompileExecutable=YES -DCompileWithJSON=YES -DCompileWithMTLN=YES cmake --build build -j diff --git a/test/mtln/CMakeLists.txt b/test/mtln/CMakeLists.txt index 2a8553a2..7dc6ae3e 100644 --- a/test/mtln/CMakeLists.txt +++ b/test/mtln/CMakeLists.txt @@ -26,20 +26,8 @@ target_link_libraries(mtln_solver_tests_fortran add_executable(mtlnsolver_tests "main_test.cpp") -message(STATUS "Copying to: ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CONFIG}/ngspice.dll") -# configure_file( -# "${NGSPICE_DIR}ngspice.dll" -# "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CONFIG}/ngspice.dll" -# COPYONLY -# ) -message(STATUS "Copying to:" $) -# configure_file( -# "${NGSPICE_DIR}ngspice.dll" -# "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CONFIG}/ngspice.dll" -# COPYONLY -# ) if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows") - add_custom_command(TARGET mtlnsolver_tests POST_BUILD # Adds a post-build event to MyTest + add_custom_command(TARGET mtlnsolver_tests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${NGSPICE_DIR}ngspice.dll" $