Commit 01c46f7 1 parent ac85ea3 commit 01c46f7 Copy full SHA for 01c46f7
File tree 1 file changed +26
-1
lines changed
1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change 15
15
# Sort input source files if you glob sources to ensure bit-for-bit
16
16
# reproducible builds (https://github.com/pybind/python_example/pull/53)
17
17
18
+
19
+ def compile_args ():
20
+ from platform import system
21
+
22
+ if system () == "Windows" :
23
+ return ["/std:c++17" ]
24
+ elif system () == "Linux" :
25
+ ignore_warnings = [
26
+ "-Wno-stringop-truncation" ,
27
+ "-Wno-catch-value" ,
28
+ "-Wno-unused-variable" ,
29
+ ]
30
+ return ["-std=c++17" ] + ignore_warnings
31
+ elif system () == "Darwin" :
32
+ ignore_warnings = [
33
+ "-Wno-unused-variable" ,
34
+ ]
35
+ return [
36
+ "-std=c++17" ,
37
+ "-mmacosx-version-min=10.15" ,
38
+ ] + ignore_warnings
39
+ else :
40
+ return []
41
+
42
+
18
43
ext_modules = [
19
44
Extension (
20
45
"nlwpy" ,
21
46
["nlwpy/src/nlw_bindings.cc" ] + glob .glob ("./src/" + "*.cc" ),
22
- # extra_compile_args=["-std=c++17"], - need all platforms
47
+ extra_compile_args = compile_args (),
23
48
include_dirs = ["include" , pybind11 .get_include ()],
24
49
# Example: passing in the version to the compiled code
25
50
define_macros = [("VERSION_INFO" , __version__ )],
You can’t perform that action at this time.
0 commit comments