Skip to content

Commit 78fc2cb

Browse files
committed
Enable more optimizations on MSVC
- Use O2 instead of Ox - Enable link time optimizations on 2.7 - Disable C++ exceptions handling on 3.5+
1 parent 44dd05b commit 78fc2cb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

setup.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ def list_files(path):
4545
'emucore/m6502/src/bspf/src environment games '
4646
'games/supported external external/TinyMT'.split()]
4747
defines = []
48+
cflags = []
49+
ldflags = []
4850
sources = [os.path.join('atari_py', 'ale_c_wrapper.cpp'),
4951
os.path.join(basepath, 'ale_interface.cpp')]
5052
includes = ['atari_py', basepath, os.path.join(basepath, 'os_dependent')]
@@ -68,17 +70,21 @@ def list_files(path):
6870
sources.append(os.path.join(basepath, 'os_dependent', fname))
6971
# disable msvc secure warnings
7072
defines.append(('_CRT_SECURE_NO_WARNINGS', None))
73+
cflags += ['/O2', '/GL', '/GF', '/EHs-']
74+
ldflags += ['/LTCG']
7175

7276

7377
ale_c = Library('ale_c',
7478
define_macros=defines,
79+
extra_compile_args=cflags,
80+
extra_link_args=ldflags,
7581
sources=sources,
7682
include_dirs=includes,
7783
)
7884

7985

8086
setup(name='atari-py',
81-
version='1.2.1',
87+
version='1.2.2',
8288
description='Python bindings to Atari games',
8389
url='https://github.com/openai/atari-py',
8490
author='OpenAI',

0 commit comments

Comments
 (0)