File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,25 +94,45 @@ def detect_gcc_on_windows():
9494
9595elif platform .system () == "Darwin" :
9696 # Clang flags for macOS
97- extra_compile_args = [
98- "-Ofast" ,
99- "-flto" ,
100- "-march=native" ,
101- "-ffast-math" ,
102- "-funroll-loops" ,
103- ]
104- extra_link_args = ["-flto" ]
97+ if os .getenv ("GITHUB_ACTIONS" ) == "true" :
98+ # Safe flags for GitHub Actions (no -march=native for universal builds)
99+ extra_compile_args = [
100+ "-O3" ,
101+ "-ffast-math" ,
102+ "-funroll-loops" ,
103+ ]
104+ extra_link_args = []
105+ else :
106+ # Local development with native optimization
107+ extra_compile_args = [
108+ "-Ofast" ,
109+ "-flto" ,
110+ "-march=native" ,
111+ "-ffast-math" ,
112+ "-funroll-loops" ,
113+ ]
114+ extra_link_args = ["-flto" ]
105115 compiler_type = "Clang"
106116else :
107117 # GCC flags for Linux and other Unix-like systems
108- extra_compile_args = [
109- "-Ofast" ,
110- "-flto" ,
111- "-march=native" ,
112- "-ffast-math" ,
113- "-funroll-loops" ,
114- ]
115- extra_link_args = ["-flto" ]
118+ if os .getenv ("GITHUB_ACTIONS" ) == "true" :
119+ # Safe flags for GitHub Actions
120+ extra_compile_args = [
121+ "-O3" ,
122+ "-ffast-math" ,
123+ "-funroll-loops" ,
124+ ]
125+ extra_link_args = []
126+ else :
127+ # Local development with native optimization
128+ extra_compile_args = [
129+ "-Ofast" ,
130+ "-flto" ,
131+ "-march=native" ,
132+ "-ffast-math" ,
133+ "-funroll-loops" ,
134+ ]
135+ extra_link_args = ["-flto" ]
116136 compiler_type = "GCC"
117137
118138print (f"Building for { platform .system ()} with { compiler_type } " )
You can’t perform that action at this time.
0 commit comments