PoseLib icon indicating copy to clipboard operation
PoseLib copied to clipboard

Remove gcc flags when using msvc for building pyposelib

Open theartful opened this issue 11 months ago • 3 comments

Building the python wheel on windows using msvc fails otherwise.

theartful avatar Jan 19 '25 18:01 theartful

Are all the target_compile_options failing?

target_compile_options(pyposelib PRIVATE -march=native -Wall -Werror -fPIC -Wno-ignored-optimization-argument)

pablospe avatar Jan 21 '25 21:01 pablospe

@pablospe Windows doesn't have an equivalent to march=native as far as I know. Instead it has specific cpu feature flags. -Wall and -Werror has their equivalents: /Wall and /WX, see https://learn.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level?view=msvc-170 As for -fPIC there is no equivalent in MSVC.

So I think we're left with /Wall and /WX, and maybe we can check for CPU features and add /arch:SSE2, /arch:AVX, etc.

theartful avatar Jan 22 '25 13:01 theartful

Btw, I didn't bother to further investigate since this same pattern was used here, where PoseLib is built: https://github.com/PoseLib/PoseLib/blob/56d158f744d3561b0b70174e6d8ca9a7fc9bd9c1/CMakeLists.txt#L23-L40

theartful avatar Jan 22 '25 13:01 theartful

@vlarsson Should we merge this?

pablospe avatar Apr 09 '25 20:04 pablospe

LGTM.

vlarsson avatar Jul 04 '25 14:07 vlarsson