Skip to content

Commit

Permalink
Improved build script for NVCC /std:c++17 internal compiler argument …
Browse files Browse the repository at this point in the history
…on Windows.
  • Loading branch information
nthnn committed Oct 10, 2024
1 parent 4f81174 commit 014d4e1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
sys.platform + '-' +
platform.machine().lower()
)
PLATFORM = platform.system()
COMPILER = 'g++'

cpp_files = []
Expand All @@ -22,7 +23,7 @@
print("No .cpp files found in the src directory.")
exit(1)

if platform.system() == 'Darwin':
if PLATFORM == 'Darwin':
COMPILER = '/opt/homebrew/opt/llvm/bin/clang++'

gpp_command = [
Expand Down Expand Up @@ -51,10 +52,10 @@
'-DNDEBUG'
]

if platform.system() != 'Windows':
if PLATFORM != 'Windows':
gpp_command.append('-flto=auto')

if platform.system() == 'Darwin':
if PLATFORM == 'Darwin':
gpp_command.append('-Xpreprocessor')
gpp_command.append('-O3')
gpp_command.remove('-Ofast')
Expand All @@ -67,6 +68,9 @@
'nvcc', '-Iinclude'
] + cpp_files + ['-o', OUTPUT_EXECUTABLE + '-cuda']

if PLATFORM == 'Windows':
nvcc_command.append('-Xcompiler /std:c++17')

os.makedirs(OUT_DIR, exist_ok=True)

try:
Expand Down

0 comments on commit 014d4e1

Please sign in to comment.