Skip to content

Commit

Permalink
Cython: fix C++ compiler flag format is different depending on the OS
Browse files Browse the repository at this point in the history
  • Loading branch information
jfranmatheu committed Feb 17, 2025
1 parent bf36fa6 commit 9e08daa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
8 changes: 4 additions & 4 deletions cy_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ def build_for_architecture(arch):

# Base compiler flags for all platforms
compiler_flags = {
'Windows': ['/O2'],
'Darwin': ['-O3'], # macOS
'Linux': ['-O3']
'Windows': ['/O2', '/std:c++17'], # MSVC flags
'Darwin': ['-O3', '-std=c++17'], # macOS/Clang flags
'Linux': ['-O3', '-std=c++17'] # Linux/GCC flags
}

# Get base optimization flag for current platform
extra_compile_args = compiler_flags.get(platform.system(), ['-O3'])
extra_compile_args = compiler_flags.get(platform.system(), ['-O3', '-std=c++17'])
extra_link_args = []

# Add architecture flags only for macOS
Expand Down
1 change: 0 additions & 1 deletion retopoflow/cy/accel2d.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# distutils: language=c++
# distutils: extra_compile_args=/std:c++17
# cython: language_level=3

from libc.stdint cimport uint8_t
Expand Down
1 change: 0 additions & 1 deletion retopoflow/cy/accel2d.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# distutils: language=c++
# distutils: extra_compile_args=/std:c++17
# cython: language_level=3
# cython: boundscheck=False
# cython: wraparound=False
Expand Down
1 change: 0 additions & 1 deletion retopoflow/cy/bmesh_enums.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# distutils: language=c++
# distutils: extra_compile_args=/std:c++17
# cython: language_level=3
# cython: boundscheck=False
# cython: wraparound=False
Expand Down

0 comments on commit 9e08daa

Please sign in to comment.