Skip to content

Commit f5b6d2a

Browse files
StrikerRUSfukatani
authored andcommitted
support Visual Studio 2019 (#297)
* Update CMakeLists.txt * Update setup.py * Update README.md
1 parent a37fcf8 commit f5b6d2a

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

RGF/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ if(MINGW)
55
set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++)
66
endif()
77
if(MSVC)
8+
cmake_minimum_required(VERSION 3.1)
89
add_definitions(-D__AZ_MSDN__)
910
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_SOURCE_DIR}/bin)
1011
set(variables

RGF/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ cmake ../ -G "Visual Studio 10 2010"
117117
cmake --build . --config Release
118118
```
119119

120-
If you are compiling on 64-bit machine, then add `Win64` to the end of generator's name: `Visual Studio 10 2010 Win64`.
120+
If you are compiling on 64-bit machine, then add `-A x64` to the end of command: `cmake ../ -G "Visual Studio 10 2010" -A x64`.
121121

122122
We tested following versions of Visual Studio:
123123

@@ -126,6 +126,7 @@ We tested following versions of Visual Studio:
126126
- Visual Studio 12 2013 [Win64]
127127
- Visual Studio 14 2015 [Win64]
128128
- Visual Studio 15 2017 [Win64]
129+
- Visual Studio 16 2019 [Win64]
129130

130131
Other versions may work but are untested.
131132

python-package/setup.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -173,13 +173,13 @@ def compile_rgf():
173173
target = os.path.join(rgf_base_dir, 'bin', 'rgf.exe')
174174
logger.info("Trying to build executable file with MSBuild "
175175
"from existing Visual Studio solution.")
176+
if IS_64BITS:
177+
arch = 'x64'
178+
else:
179+
arch = 'Win32'
176180
platform_toolsets = ('Windows7.1SDK', 'v100', 'v110',
177-
'v120', 'v140', 'v141')
181+
'v120', 'v140', 'v141', 'v142')
178182
for platform_toolset in platform_toolsets:
179-
if IS_64BITS:
180-
arch = 'x64'
181-
else:
182-
arch = 'Win32'
183183
success = silent_call(('MSBuild',
184184
'rgf.sln',
185185
'/p:Configuration=Release',
@@ -201,12 +201,10 @@ def compile_rgf():
201201
logger.info("Trying to build executable file with CMake and MSBuild.")
202202
generators = ('Visual Studio 10 2010', 'Visual Studio 11 2012',
203203
'Visual Studio 12 2013', 'Visual Studio 14 2015',
204-
'Visual Studio 15 2017')
204+
'Visual Studio 15 2017', 'Visual Studio 16 2019')
205205
for generator in generators:
206-
if IS_64BITS:
207-
generator += ' Win64'
208206
clear_folder(os.path.join(rgf_base_dir, 'build'))
209-
success = silent_call(('cmake', '../', '-G', generator))
207+
success = silent_call(('cmake', '../', '-G', generator, '-A', arch))
210208
success &= silent_call(('cmake', '--build', '.', '--config', 'Release'))
211209
if success and os.path.isfile(target) and is_rgf_response(target):
212210
break

0 commit comments

Comments
 (0)