From c316d02d75530fac29051895ef2531641719415d Mon Sep 17 00:00:00 2001 From: juliannguyen4 <109386615+juliannguyen4@users.noreply.github.com> Date: Wed, 13 Sep 2023 13:15:01 -0700 Subject: [PATCH] Toggle btwn optimized and debug flags --- .github/workflows/build-wheels.yml | 18 +++++++++++++++--- setup.py | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 5e5f51ee5..7008d06c1 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -174,10 +174,14 @@ jobs: crudini --set config.conf enterprise-edition hosts ${SERVER_DOCKER_IP}:3000 working-directory: test - - name: Determine type of build + - name: Set debug flags run: echo "CFLAGS=-Og -g" >> $GITHUB_ENV if: ${{ inputs.optimized-or-debug == 'debug' }} + - name: Set optimized flags + run: echo "CFLAGS=-O1" >> $GITHUB_ENV + if: ${{ inputs.optimized-or-debug == 'optimized' }} + - name: Build wheel uses: pypa/cibuildwheel@v2.11.2 env: @@ -238,10 +242,14 @@ jobs: crudini --set config.conf enterprise-edition hosts ${SERVER_DOCKER_IP}:3000 working-directory: test - - name: Determine type of build + - name: Set debug flags run: echo "CFLAGS=-Og -g" >> $GITHUB_ENV if: ${{ inputs.optimized-or-debug == 'debug' }} + - name: Set optimized flags + run: echo "CFLAGS=-O1" >> $GITHUB_ENV + if: ${{ inputs.optimized-or-debug == 'optimized' }} + - name: Build wheel uses: pypa/cibuildwheel@v2.11.2 env: @@ -272,10 +280,14 @@ jobs: with: submodules: recursive - - name: Determine type of build + - name: Set debug flags run: echo "CFLAGS=-Og -g" >> $GITHUB_ENV if: ${{ inputs.optimized-or-debug == 'debug' }} + - name: Set optimized flags + run: echo "CFLAGS=-O1" >> $GITHUB_ENV + if: ${{ inputs.optimized-or-debug == 'optimized' }} + - name: Build wheel uses: pypa/cibuildwheel@v2.11.2 env: diff --git a/setup.py b/setup.py index 163e2b595..a3d7f7219 100644 --- a/setup.py +++ b/setup.py @@ -58,7 +58,7 @@ ['/usr/local/opt/openssl/include'] + \ ['aerospike-client-c/modules/common/src/include'] extra_compile_args = [ - '-std=gnu99', '-Wall', '-fPIC', '-DDEBUG', '-O1', + '-std=gnu99', '-Wall', '-fPIC', '-DDEBUG', '-fno-common', '-fno-strict-aliasing', '-Wno-strict-prototypes', '-D_FILE_OFFSET_BITS=64', '-D_REENTRANT', '-DMARCH_' + machine,