[buildcore] Add support for MSVC

This commit is contained in:
Gary Talent 2022-03-12 11:50:21 -06:00
parent 6e51c221af
commit 399f117eab
3 changed files with 13 additions and 1 deletions

View File

@ -31,7 +31,9 @@ else()
endif()
endif()
if(NOT MSVC)
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:preprocessor")
else()
# forces colored output when using ninja
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color")
# enable warnings

View File

@ -135,6 +135,11 @@ conan-config:
${ENV_RUN} conan profile new ${PROJECT_NAME} --detect --force
ifeq ($(OS),linux)
${ENV_RUN} conan profile update settings.compiler.libcxx=libstdc++11 ${PROJECT_NAME}
else
${ENV_RUN} conan profile update settings.compiler.cppstd=20 ${PROJECT_NAME}
ifeq ($(OS),windows)
${ENV_RUN} conan profile update settings.compiler.runtime=static ${PROJECT_NAME}
endif
endif
.PHONY: conan
conan:

View File

@ -62,6 +62,10 @@ def main():
print('Error: Invalid build tool')
sys.exit(1)
win_target = ''
if platform.system() != 'Windows':
win_target = '-A x64'
project_dir = os.getcwd()
build_dir = '{:s}/build/{:s}'.format(project_dir, build_config)
rm(build_dir)
@ -73,6 +77,7 @@ def main():
'-DUSE_ASAN={:s}'.format(sanitizer_status),
'-DBUILDCORE_BUILD_CONFIG={:s}'.format(build_config),
'-DBUILDCORE_TARGET={:s}'.format(args.target),
win_target,
]
if qt_path != '':
cmake_cmd.append(qt_path)