File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 37
37
strategy :
38
38
fail-fast : false
39
39
matrix :
40
- os : [ubuntu-latest, macos-12 , macos-14, windows-latest]
40
+ os : [ubuntu-latest, macos-13 , macos-14, windows-latest]
41
41
42
42
steps :
43
43
- uses : actions/checkout@v4
Original file line number Diff line number Diff line change @@ -63,15 +63,28 @@ nanobind_add_module(
63
63
src/signalsmith-bindings.cpp
64
64
)
65
65
66
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
67
+ execute_process (
68
+ COMMAND ${CMAKE_CXX_COMPILER} --version
69
+ OUTPUT_VARIABLE CLANG_VERSION_OUTPUT
70
+ OUTPUT_STRIP_TRAILING_WHITESPACE
71
+ )
72
+
73
+ string (REGEX MATCH "([0-9]+)\\ .([0-9]+)\\ .([0-9]+)" CLANG_VERSION_MATCH "${CLANG_VERSION_OUTPUT} " )
74
+ set (CLANG_MAJOR_VERSION ${CMAKE_MATCH_1} )
75
+ set (CLANG_MINOR_VERSION ${CMAKE_MATCH_2} )
76
+ set (CLANG_PATCH_VERSION ${CMAKE_MATCH_3} )
77
+ endif ()
78
+
66
79
# Optimize Signalsmith library
67
80
if (MSVC )
68
81
target_compile_options (Signalsmith PRIVATE /O2 /fp:fast )
69
82
target_link_options (Signalsmith PRIVATE /GL /LTCG )
70
83
else ()
71
- if (NOT APPLE )
72
- target_compile_options (Signalsmith PRIVATE -O3 -ffast-math )
84
+ if (APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CLANG_MAJOR_VERSION EQUAL 16 AND CLANG_MINOR_VERSION EQUAL 0 AND CLANG_PATCH_VERSION EQUAL 0 )
85
+ target_compile_options (Signalsmith PRIVATE -O3 )
73
86
else ()
74
- target_compile_options (Signalsmith PRIVATE -O3 )
87
+ target_compile_options (Signalsmith PRIVATE -O3 -ffast-math )
75
88
endif ()
76
89
target_link_options (Signalsmith PRIVATE -flto )
77
90
endif ()
You can’t perform that action at this time.
0 commit comments