Skip to content

Windows build support. #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion optix/optix_includes.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#pragma once

#if defined(_MSC_VER)
#define NOMINMAX
#endif

#include <optix.h>
#include <optix_stubs.h>
#include <optix_function_table_definition.h>
Expand All @@ -13,4 +17,4 @@ inline void optix_check_return(OptixResult result) {
ss << ": " << optixGetErrorString(result);
throw std::runtime_error(ss.str());
}
}
}
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from setuptools import setup, Extension, find_packages
from Cython.Build import cythonize
import re
import os
from pathlib import Path


Expand Down Expand Up @@ -49,8 +50,13 @@ def import_module_from_path(path):
'_OPTIX_VERSION_MICRO': optix_version_micro
}

libraries=[]
if os.name == 'nt':
# OptiX uses some Windows Registry API(e.g. RegCloseKey)
libraries.append('advapi32')

extensions = [Extension("*", ["optix/*.pyx"],
include_dirs=[cuda_include_path, optix_include_path])]
include_dirs=[cuda_include_path, optix_include_path], libraries=libraries)]
extensions = cythonize(extensions, language_level="3",
compile_time_env=cython_compile_env, build_dir="build")

Expand Down