@@ -53,7 +53,7 @@ if args.compiler is None:
5353
5454if args .flags is None :
5555 args .flags = getFlags (args .compiler )
56- args .flags += " -march=native "
56+ args .flags += " -march=x86-64 -mtune=generic "
5757
5858
5959if args .libdeflate is None :
@@ -76,7 +76,8 @@ if args.libdeflate is None:
7676
7777 env = os .environ .copy ()
7878 env ['CC' ] = args .compiler
79- env ['CFLAGS' ] = flags = getFlags (args .compiler )
79+ env ['CFLAGS' ] = args .flags
80+ env ['CPPFLAGS' ] = args .flags
8081 env ['DISABLE_GZIP' ] = '1'
8182 env ['DISABLE_ZLIB' ] = '1'
8283 p = Popen (['make' , 'libdeflate.a' ], stdin = PIPE , stdout = PIPE , stderr = PIPE , env = env )
@@ -121,7 +122,7 @@ if args.libglfw3 is None:
121122 env ['CC' ] = args .compiler
122123 env ['CXX' ] = args .compiler
123124
124- p = Popen (['cmake' , '-DCMAKE_BUILD_TYPE=Release' , '-DGLFW_BUILD_EXAMPLES=OFF' , '-DGLFW_BUILD_DOCS=OFF' , '-DGLFW_INSTALL=OFF' , '-DGLFW_BUILD_TESTS=OFF' , '..' ], stdin = PIPE , stdout = PIPE , stderr = PIPE , env = env )
125+ p = Popen (['cmake' , '-DCMAKE_BUILD_TYPE=Release' , '-DGLFW_BUILD_EXAMPLES=OFF' , '-DGLFW_BUILD_DOCS=OFF' , '-DGLFW_INSTALL=OFF' , '-DGLFW_BUILD_TESTS=OFF' , '-DCMAKE_CXX_FLAGS="{}"' . format ( args . flags ), '-DCMAKE_C_FLAGS="{}"' . format ( args . flags ), ' ..' ], stdin = PIPE , stdout = PIPE , stderr = PIPE , env = env )
125126 output , err = p .communicate ()
126127 if p .returncode != 0 :
127128 raise SystemExit ("Error running cmake on glfw: " + err .decode ('utf-8' ))
@@ -151,7 +152,7 @@ if p.returncode != 0:
151152 raise SystemExit ("Error making glad.o: " + err .decode ('utf-8' ))
152153
153154print ("Building PretextView" )
154- links = " -ldl -lX11 -lm" if "linux" in sys .platform else " -framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo"
155+ links = " -ldl -lX11 -lm" if "linux" in sys .platform else " -mmacosx-version-min=10.10 - framework Cocoa -framework OpenGL -framework IOKit -framework CoreVideo"
155156command = args .compiler + " -std=c++11 PretextView.cpp " + args .libdeflate + " " + args .libglfw3 + " glad.o " + args .flags + " -o PretextView -Iinclude" + links
156157p = Popen (command .strip ().split (), stdin = PIPE , stdout = PIPE , stderr = PIPE )
157158output , err = p .communicate ()
0 commit comments