Skip to content

Commit

Permalink
Fixing env vars in windows worflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lmdiazangulo committed Feb 1, 2024
1 parent c9bbe6a commit 9933444
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/set_vars_windows.bat
Original file line number Diff line number Diff line change
@@ -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%
5 changes: 1 addition & 4 deletions .github/workflows/windows-intelLLVM.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 1 addition & 13 deletions test/mtln/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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:" $<TARGET_FILE_DIR:mtlnsolver_tests>)
# 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"
$<TARGET_FILE_DIR:mtlnsolver_tests>
Expand Down

0 comments on commit 9933444

Please sign in to comment.