Skip to content

Commit

Permalink
windows fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wenzel Jakob committed Oct 13, 2015
1 parent db028d6 commit 607654f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,16 @@ add_library(example SHARED
# Don't add a 'lib' prefix to the shared library
set_target_properties(example PROPERTIES PREFIX "")

# Write the output file directly into the 'example' directory
set_target_properties(example PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/example)
# Always write the output file directly into the 'example' directory (even on MSVC)
set(CompilerFlags
LIBRARY_OUTPUT_DIRECTORY LIBRARY_OUTPUT_DIRECTORY_RELEASE LIBRARY_OUTPUT_DIRECTORY_DEBUG
LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO
RUNTIME_OUTPUT_DIRECTORY RUNTIME_OUTPUT_DIRECTORY_RELEASE RUNTIME_OUTPUT_DIRECTORY_DEBUG
RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO)

foreach(CompilerFlag ${CompilerFlags})
set_target_properties(example PROPERTIES ${CompilerFlag} ${PROJECT_SOURCE_DIR}/example)
endforeach()

if (WIN32)
if (MSVC)
Expand Down
6 changes: 5 additions & 1 deletion example/run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

remove_unicode_marker = re.compile(r'u(\'[^\']*\')')
remove_long_marker = re.compile(r'([0-9])L')
remove_hex = re.compile(r'0x[0-9a-f]+')
remove_hex = re.compile(r'0x[0-9a-fA-F]+')
shorten_floats = re.compile(r'([1-9][0-9]*\.[0-9]{4})[0-9]*')


Expand All @@ -23,6 +23,10 @@ def sanitize(lines):
line = line.replace('example.', '')
line = line.replace('method of builtins.PyCapsule instance', '')
line = line.strip()
if sys.platform == 'win32':
lower = line.lower()
if 'constructor' in lower or 'destructor' in lower or 'ref' in lower:
line = ""
lines[i] = line

lines = '\n'.join(sorted([l for l in lines if l != ""]))
Expand Down

0 comments on commit 607654f

Please sign in to comment.