From 70416168371977b71cd9bfb96b85878728d9a973 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 26 Aug 2017 10:36:04 +0530 Subject: [PATCH] More semantic handling of profile arg when compiling --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index a9b00c875..97aefc38e 100755 --- a/setup.py +++ b/setup.py @@ -111,8 +111,6 @@ def init_env(debug=False, sanitize=False, native_optimizations=True, profile=Fal if ccver < (5, 2) and cc == 'gcc': missing_braces = '-Wno-missing-braces' optimize = '-ggdb' if debug or sanitize else '-O3' - if profile: - optimize = '-g' sanitize_args = get_sanitize_args(cc, ccver) if sanitize else set() cflags = os.environ.get( 'OVERRIDE_CFLAGS', ( @@ -134,6 +132,7 @@ def init_env(debug=False, sanitize=False, native_optimizations=True, profile=Fal if profile: cflags.append('-DWITH_PROFILER') + cflags.append('-g') ldflags.append('-lprofiler') cflags.append('-pthread') # We add 4000 to the primary version because vim turns on SGR mouse mode