From 9e08daa9f8a8d7ed263dbece4d85d1de1a4a7f1c Mon Sep 17 00:00:00 2001 From: jfranmatheu <45881831+jfranmatheu@users.noreply.github.com> Date: Mon, 17 Feb 2025 11:32:48 +0100 Subject: [PATCH] Cython: fix C++ compiler flag format is different depending on the OS --- cy_setup.py | 8 ++++---- retopoflow/cy/accel2d.pxd | 1 - retopoflow/cy/accel2d.pyx | 1 - retopoflow/cy/bmesh_enums.pxd | 1 - 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/cy_setup.py b/cy_setup.py index 858e4479..2f73eb1f 100644 --- a/cy_setup.py +++ b/cy_setup.py @@ -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 diff --git a/retopoflow/cy/accel2d.pxd b/retopoflow/cy/accel2d.pxd index 4b73f3a9..c0f29992 100644 --- a/retopoflow/cy/accel2d.pxd +++ b/retopoflow/cy/accel2d.pxd @@ -1,5 +1,4 @@ # distutils: language=c++ -# distutils: extra_compile_args=/std:c++17 # cython: language_level=3 from libc.stdint cimport uint8_t diff --git a/retopoflow/cy/accel2d.pyx b/retopoflow/cy/accel2d.pyx index 010189a5..000d4e15 100644 --- a/retopoflow/cy/accel2d.pyx +++ b/retopoflow/cy/accel2d.pyx @@ -1,5 +1,4 @@ # distutils: language=c++ -# distutils: extra_compile_args=/std:c++17 # cython: language_level=3 # cython: boundscheck=False # cython: wraparound=False diff --git a/retopoflow/cy/bmesh_enums.pxd b/retopoflow/cy/bmesh_enums.pxd index 48509f3f..0c583423 100644 --- a/retopoflow/cy/bmesh_enums.pxd +++ b/retopoflow/cy/bmesh_enums.pxd @@ -1,5 +1,4 @@ # distutils: language=c++ -# distutils: extra_compile_args=/std:c++17 # cython: language_level=3 # cython: boundscheck=False # cython: wraparound=False