Skip to content

Commit

Permalink
Enable more optimizations on MSVC
Browse files Browse the repository at this point in the history
- Use O2 instead of Ox
- Enable link time optimizations on 2.7
- Disable C++ exceptions handling on 3.5+
  • Loading branch information
Kojoley committed Jul 26, 2020
1 parent 44dd05b commit 78fc2cb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def list_files(path):
'emucore/m6502/src/bspf/src environment games '
'games/supported external external/TinyMT'.split()]
defines = []
cflags = []
ldflags = []
sources = [os.path.join('atari_py', 'ale_c_wrapper.cpp'),
os.path.join(basepath, 'ale_interface.cpp')]
includes = ['atari_py', basepath, os.path.join(basepath, 'os_dependent')]
Expand All @@ -68,17 +70,21 @@ def list_files(path):
sources.append(os.path.join(basepath, 'os_dependent', fname))
# disable msvc secure warnings
defines.append(('_CRT_SECURE_NO_WARNINGS', None))
cflags += ['/O2', '/GL', '/GF', '/EHs-']
ldflags += ['/LTCG']


ale_c = Library('ale_c',
define_macros=defines,
extra_compile_args=cflags,
extra_link_args=ldflags,
sources=sources,
include_dirs=includes,
)


setup(name='atari-py',
version='1.2.1',
version='1.2.2',
description='Python bindings to Atari games',
url='https://github.com/openai/atari-py',
author='OpenAI',
Expand Down

0 comments on commit 78fc2cb

Please sign in to comment.