Skip to content

Commit

Permalink
using nmake on Windows
Browse files Browse the repository at this point in the history
and suppressing MSVC warning when irrelevant
  • Loading branch information
TysonRayJones committed Feb 27, 2025
1 parent 46422b8 commit 8cfff7b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,20 @@ jobs:
os: [ubuntu-latest, macos-latest, windows-latest]
precision: [1, 2, 4]

# assign each OS a bespoke compilter
# assign each OS bespoke compilers, cmake and make flags
include:
- os: ubuntu-latest
compiler: g++
cmakeflag:
makecmd: make
- os: macos-latest
compiler: clang
compiler: clang++
cmakeflag:
makecmd: make
- os: windows-latest
compiler: cl
cmakeflag: -G "NMake Makefiles"
makecmd: nmake

steps:
- name: Get QuEST
Expand All @@ -45,11 +51,12 @@ jobs:
working-directory: build_dir
run: >
cmake ..
${{ matrix.cmakeflag }}
-DENABLE_MULTITHREADING=OFF
-DFLOAT_PRECISION=${{ matrix.precision }}
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
- name: Run Make
working-directory: build_dir
run: make
run: ${{ matrix.makecmd }}

20 changes: 13 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,19 @@ message(STATUS "Deprecated API support is turned ${ENABLE_DEPRECATED_API}. Set E

# Windows Specific Options
if(WIN32)
set(ENABLE_MULTITHREADING OFF)
message(WARNING "multithreading disabled on Windows")
# Force MSVC to export all symbols in a shared library, like GCC and clang
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
if (ENABLE_TESTING)
set(BUILD_SHARED_LIBS OFF)
endif ()

# Warn MSVC-multithreading not supported
if (ENABLE_MULTITHREADING)
message(WARNING "Multithreading is currently not supported on Windows and has been disabled")
endif()

set(ENABLE_MULTITHREADING OFF)

# Force MSVC to export all symbols in a shared library, like GCC and clang
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
if (ENABLE_TESTING)
set(BUILD_SHARED_LIBS OFF)
endif()
endif()

## Library
Expand Down

0 comments on commit 8cfff7b

Please sign in to comment.