diff --git a/CMakeLists.txt b/CMakeLists.txt
index 06ebee1..1f5dea3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,179 +1,182 @@
cmake_minimum_required(VERSION 2.8.8)
# Start project, set version here.
project("RoSA")
# NOTE: Adjust the variables version and release in docs/conf.py according to
# version changes here.
set(ROSA_VERSION_MAJOR 0)
set(ROSA_VERSION_MINOR 1)
set(ROSA_VERSION_PATCH 0)
# Add path for custom modules
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules"
)
# Package information
if( NOT PACKAGE_VERSION )
set(PACKAGE_VERSION "${ROSA_VERSION_MAJOR}.${ROSA_VERSION_MINOR}.${ROSA_VERSION_PATCH}")
endif()
set(PACKAGE_NAME "Research on Self-Awareness Framework")
set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
set(PACKAGE_BUGREPORT "david.juhasz@tuwien.ac.at")
#TODO: cpack?
# Sanity check we are to make out-of-tree build
if( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
message(FATAL_ERROR "In-source builds are not allowed.")
endif()
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
# Set various paths
set(ROSA_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(ROSA_MAIN_INCLUDE_DIR ${ROSA_MAIN_SRC_DIR}/include)
set(ROSA_MAIN_BIN_DIR ${ROSA_MAIN_SRC_DIR}/bin)
set(ROSA_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(ROSA_RUNTIME_OUTPUT_INTDIR ${ROSA_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
set(ROSA_LIBRARY_OUTPUT_INTDIR ${ROSA_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib)
set(ROSA_TOOLS_BINARY_DIR ${ROSA_RUNTIME_OUTPUT_INTDIR})
set(ROSA_LIBRARY_DIR ${ROSA_LIBRARY_OUTPUT_INTDIR})
set(ROSA_INCLUDE_DIR ${ROSA_BINARY_DIR}/include)
# Set build options
option(ROSA_INCLUDE_TOOLS "Generate build targets for RoSA tools." ON)
option(ROSA_INCLUDE_EXAMPLES "Generate build targets for RoSA examples." ON)
option(ROSA_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
# Assertions are always enabled for Debug builds, this option is respected only
# for non-Debug builds.
option(ROSA_ENABLE_ASSERTIONS "Enable assertions for non-Debug builds." OFF)
+option(ROSA_ENABLE_CLANG_TIDY "Run clang-tidy checks when building RoSA." ON)
+
option(ROSA_INCLUDE_DOCS "Generate build targets for RoSA documentation." ON)
option(ROSA_BUILD_DOCS "Build RoSA documentation." OFF)
option(ROSA_ENABLE_DOXYGEN "Use doxygen to generate RoSA API documentation." OFF)
option(ROSA_ENABLE_SPHINX "Use Sphinx to generate RoSA documentation." OFF)
# All options referred to from HandleROSAOptions have to be specified
# BEFORE this include, otherwise options will not be correctly set on
# first cmake run
include(config-ix)
include(HandleROSAOptions)
# Configure the ROSA configuration header file.
if( ROSA_LOG_LEVEL )
if(${ROSA_LOG_LEVEL} EQUAL 5)
set(ROSA_LOG_LEVEL_INT -1)
else()
set(ROSA_LOG_LEVEL_INT ${ROSA_LOG_LEVEL})
endif()
else()
set(ROSA_LOG_LEVEL_INT -1)
endif()
configure_file(
${ROSA_MAIN_INCLUDE_DIR}/rosa/config/rosa_config.h.cmake
${ROSA_INCLUDE_DIR}/rosa/config/rosa_config.h
)
# They are not referenced. See set_output_directory().
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ROSA_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ROSA_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ROSA_BINARY_DIR}/lib)
# Set include directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories(${ROSA_INCLUDE_DIR} ${ROSA_MAIN_INCLUDE_DIR})
# Set extra compiler options for Visual Studio
if ( MSVC )
add_definitions(-EHsc) # Use Exception Handling
endif()
# Set up YCM
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
message("Set compilation_database_folder in .ymc_extra_conf.py in the source directory if you want to use YMC.")
# Add parts of the project
include(AddROSATools)
add_subdirectory(lib)
if( ROSA_INCLUDE_TOOLS )
add_subdirectory(tools)
endif()
if( ROSA_INCLUDE_EXAMPLES )
add_subdirectory(examples)
endif()
if( ROSA_INCLUDE_DOCS )
add_subdirectory(docs)
endif()
#TODO: install?
# Print summary
set(ROSA_ENABLE_ASSERTIONS_STR "OFF")
if( ROSA_ENABLE_ASSERTIONS_INT EQUAL 1 )
- set(ENABLE_ASSERTIONS_STR "ON")
+ set(ROSA_ENABLE_ASSERTIONS_STR "ON")
endif()
set(LOG_LEVEL_STR "disabled")
if(ROSA_LOG_LEVEL)
if(${ROSA_LOG_LEVEL} EQUAL 0)
set(LOG_LEVEL_STR "ERROR")
elseif(${ROSA_LOG_LEVEL} EQUAL 1)
set(LOG_LEVEL_STR "WARNING")
elseif(${ROSA_LOG_LEVEL} EQUAL 2)
set(LOG_LEVEL_STR "INFO")
elseif(${ROSA_LOG_LEVEL} EQUAL 3)
set(LOG_LEVEL_STR "DEBUG")
elseif(${ROSA_LOG_LEVEL} EQUAL 4)
set(LOG_LEVEL_STR "TRACE")
elseif(${ROSA_LOG_LEVEL} EQUAL 5)
set(LOG_LEVEL_STR "disabled")
else()
set(LOG_LEVEL_STR "invalid")
endif()
endif()
message(STATUS
"\n====================| Build Summary |===================="
"\n"
"\nRoSA version: ${PACKAGE_VERSION}"
"\n"
"\nBuild type: ${CMAKE_BUILD_TYPE}"
- "\nAssertions: ${ENABLE_ASSERTIONS_STR}"
+ "\nAssertions: ${ROSA_ENABLE_ASSERTIONS_STR}"
+ "\nClang-tidy: ${ROSA_ENABLE_CLANG_TIDY}"
"\nLog level: ${LOG_LEVEL_STR}"
"\n"
"\nBuild tools: ${ROSA_INCLUDE_TOOLS}"
"\nBuild examples: ${ROSA_INCLUDE_EXAMPLES}"
"\nInclude docs: ${ROSA_INCLUDE_DOCS}"
"\nBuild docs: ${ROSA_BUILD_DOCS}"
"\n -enable doxygen: ${ROSA_ENABLE_DOXYGEN}"
"\n -enable Sphinx: ${ROSA_ENABLE_SPHINX}"
"\n"
"\nCC: ${CMAKE_C_COMPILER}"
"\nCFLAGS: ${CMAKE_C_FLAGS}"
"\nCXX: ${CMAKE_CXX_COMPILER}"
"\nCXXFLAGS: ${CMAKE_CXX_FLAGS}"
"\nLIBRARIES: ${LD_FLAGS}"
"\n"
"\nSource directory: ${ROSA_MAIN_SRC_DIR}"
"\nBuild directory: ${ROSA_BINARY_DIR}"
"\nExecutable path: ${ROSA_TOOLS_BINARY_DIR}"
"\nLibrary path: ${ROSA_LIBRARY_DIR}"
"\nGenerator: ${CMAKE_GENERATOR}"
"\n"
"\n===========================================================\n")
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 8a15349..337e182 100755
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -1,51 +1,76 @@
# available programs checks
function(rosa_find_program name)
string(TOUPPER ${name} NAME)
string(REGEX REPLACE "\\." "_" NAME ${NAME})
find_program(ROSA_PATH_${NAME} NAMES ${ARGV})
mark_as_advanced(ROSA_PATH_${NAME})
if(ROSA_PATH_${NAME})
set(HAVE_${NAME} 1 CACHE INTERNAL "Is ${name} available ?")
mark_as_advanced(HAVE_${NAME})
else(ROSA_PATH_${NAME})
set(HAVE_${NAME} "" CACHE INTERNAL "Is ${name} available ?")
endif(ROSA_PATH_${NAME})
endfunction()
+if (ROSA_ENABLE_CLANG_TIDY)
+ message(STATUS "Clang-tidy enabled.")
+
+ # Make sure CMake knows about clang-tidy
+ cmake_minimum_required(VERSION 3.6.0)
+
+ # clang-tidy specific options
+ set(ROSA_CLANG_TIDY_PATH "" CACHE STRING "Custom path for clang-tidy executable.")
+ option(ROSA_CLANG_TIDY_FIX "Apply suggested clang-tidy fixes to the sources." OFF)
+
+ # Find clang-tidy
+ if ("${ROSA_CLANG_TIDY_PATH}" STREQUAL "")
+ find_program(CLANG_TIDY clang-tidy)
+ else()
+ find_program(CLANG_TIDY clang-tidy PATHS ${ROSA_CLANG_TIDY_PATH})
+ endif()
+
+ if (${CLANG_TIDY} STREQUAL "CLANG_TIDY-NOTFOUND")
+ message(FATAL_ERROR "Clang-tidy cannot be found!")
+ endif()
+
+else()
+ message(STATUS "Clang-tidy disabled.")
+endif()
+
if (ROSA_ENABLE_DOXYGEN)
rosa_find_program(dot)
endif ()
if (ROSA_ENABLE_DOXYGEN)
message(STATUS "Doxygen enabled.")
find_package(Doxygen REQUIRED)
if (DOXYGEN_FOUND)
# If we find doxygen and we want to enable doxygen by default create a
# global aggregate doxygen target for generating llvm and any/all
# subprojects doxygen documentation.
if (ROSA_BUILD_DOCS)
add_custom_target(doxygen ALL)
endif()
option(ROSA_DOXYGEN_EXTERNAL_SEARCH "Enable doxygen external search." OFF)
if (ROSA_DOXYGEN_EXTERNAL_SEARCH)
set(ROSA_DOXYGEN_SEARCHENGINE_URL "" CACHE STRING "URL to use for external search.")
set(ROSA_DOXYGEN_SEARCH_MAPPINGS "" CACHE STRING "Doxygen Search Mappings.")
endif()
endif()
else()
message(STATUS "Doxygen disabled.")
endif()
if (ROSA_ENABLE_SPHINX)
message(STATUS "Sphinx enabled.")
find_package(Sphinx REQUIRED)
if (ROSA_BUILD_DOCS)
add_custom_target(sphinx ALL)
endif()
else()
message(STATUS "Sphinx disabled.")
endif()
diff --git a/cmake/modules/HandleROSAOptions.cmake b/cmake/modules/HandleROSAOptions.cmake
index 8575440..7a618c0 100644
--- a/cmake/modules/HandleROSAOptions.cmake
+++ b/cmake/modules/HandleROSAOptions.cmake
@@ -1,91 +1,102 @@
# This CMake module is responsible for interpreting the user defined ROSA_
# options and executing the appropriate CMake commands to realize the users'
# selections.
include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)
if( CMAKE_COMPILER_IS_GNUCXX )
set(ROSA_COMPILER_IS_GCC_COMPATIBLE ON)
elseif( "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" )
set(ROSA_COMPILER_IS_GCC_COMPATIBLE ON)
elseif( MSVC )
set(ROSA_COMPILER_IS_GCC_COMPATIBLE OFF)
endif()
function(append value)
foreach(variable ${ARGN})
set(${variable} "${${variable}} ${value}" PARENT_SCOPE)
endforeach(variable)
endfunction()
function(append_if condition value)
if (${condition})
foreach(variable ${ARGN})
set(${variable} "${${variable}} ${value}" PARENT_SCOPE)
endforeach(variable)
endif()
endfunction()
# NDEBUG on non-Debug builds
append("-DNDEBUG" CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_MINSIZEREL)
# Assertions are always enabled on Debug builds, this is interesting for
# non-Debug builds.
-if( NOT uppercase_CMAKE_BUILD_TYPE EQUAL "DEBUG" AND ROSA_ENABLE_ASSERTIONS )
+if( NOT "${uppercase_CMAKE_BUILD_TYPE}" STREQUAL "DEBUG" AND ${ROSA_ENABLE_ASSERTIONS} )
# MSVC doesn't like _DEBUG on release builds. See PR 4379.
if( NOT MSVC )
add_definitions( -D_DEBUG )
set(ENABLE_ASSERTIONS "1")
else()
set(ENABLE_ASSERTIONS "0")
endif()
# On non-Debug builds we NDEBUG, but in this case we need to undefine it:
add_definitions(-UNDEBUG)
# Also remove /D NDEBUG to avoid MSVC warnings about conflicting defines.
foreach (flags_var_to_scrub
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_C_FLAGS_MINSIZEREL)
string (REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " "
"${flags_var_to_scrub}" "${${flags_var_to_scrub}}")
endforeach()
endif()
set(ROSA_ENABLE_ASSERTIONS_INT -1)
-if( uppercase_CMAKE_BUILD_TYPE EQUAL "DEBUG" OR ROSA_ENABLE_ASSERTIONS )
+if( "${uppercase_CMAKE_BUILD_TYPE}" STREQUAL "DEBUG" OR ${ROSA_ENABLE_ASSERTIONS} )
set(ROSA_ENABLE_ASSERTIONS_INT 1)
endif()
#FIXME: Disable RTTI and exceptions, once gen_agent_test2 is cleared up.
if( ROSA_COMPILER_IS_GCC_COMPATIBLE )
append("-Wall -Wextra -Wdocumentation -Werror" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
append_if(ROSA_ENABLE_PEDANTIC "-pedantic -Wno-long-long" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
check_cxx_compiler_flag("-std=c++14" CXX_SUPPORTS_CXX14)
if ( CXX_SUPPORTS_CXX14 )
append("-std=c++14" CMAKE_CXX_FLAGS)
else()
message(FATAL_ERROR "RoSA requires C++14 support but the '-std=c++14' flag isn't supported.")
endif()
check_c_compiler_flag("-std=c11" C_SUPPORTS_C11)
if ( C_SUPPORTS_C11 )
append("-std=c11" CMAKE_C_FLAGS)
else()
message(FATAL_ERROR "RoSA requires C11 support but the '-std=c11' flag isn't supported.")
endif()
else ( ROSA_COMPILER_IS_GCC_COMPATIBLE )
# FIXME: set the same things as for GCC-compatible compilers
endif( ROSA_COMPILER_IS_GCC_COMPATIBLE )
+if( ROSA_ENABLE_CLANG_TIDY )
+
+ # Set clang-tidy arguments, use the same for both C and CXX.
+ set(CMAKE_C_CLANG_TIDY "${CLANG_TIDY};-header-filter=.*")
+ set(CMAKE_CXX_CLANG_TIDY ${CMAKE_C_CLANG_TIDY})
+
+ # Apply suggested fixes if requested.
+ append_if(ROSA_CLANG_TIDY_FIX ",-fix" CMAKE_C_CLANG_TIDY CMAKE_CXX_CLANG_TIDY)
+
+endif( ROSA_ENABLE_CLANG_TIDY )
+
diff --git a/docs/Build.rst b/docs/Build.rst
index 32d5e8e..919bb3a 100755
--- a/docs/Build.rst
+++ b/docs/Build.rst
@@ -1,229 +1,263 @@
===========================
Building the RoSA Framework
===========================
.. contents::
:local:
General notes
=============
* The framework is delivered with a CMake project, which can be used to generate
build projects to build the framework.
* The provided CMake project supports out-of-tree builds only, i.e. one must use
a separate build directory outside of the RoSA source directory.
Build Dependencies
==================
In order to build RoSA, the following tools are required:
-* `CMake `_ (minimum version 2.8.8);
+* `CMake `_ (minimum version 3.6.0 if clang-tidy is used,
+ 2.8.8 otherwise);
* Build system of your choice that can be targeted by CMake -- including a
compiler supporting C++14.
+The following addition tools are required to check the used coding standard:
+
+* `clang-tidy `_
+
The following additional tools are required to generate documentation:
* `Doxygen `_ -- for generating API documentation;
* `Graphviz `_ -- not necessary, but the API
documentation has nicer graphics when `dot` is available;
* `Sphinx `_ (with *Python 2*) -- for generating
documentation.
CMake Variables
===============
Beyond the usual CMake variables, the following project-related options are
available:
`ROSA_INCLUDE_TOOLS`
Generate build targets for RoSA tools. The tools are also built when the
option is set to `ON`, which is the default setting.
`ROSA_INCLUDE_EXAMPLES`
Generate build targets for RoSA examples. The examples are also built when the
option is set to `ON`, which is the default setting.
`ROSA_ENABLE_PEDANTIC`
Compile the framework with using `-pedantic`. The option defaults to `ON`.
`ROSA_ENABLE_ASSERTIONS`
Enable assertions for non-Debug builds, which defaults to `OFF`.
Note that assertions are always enabled for Debug builds and this option is
ignored for such builds.
+`ROSA_ENABLE_CLANG_TIDY`
+ Run *clang-tidy* checks when building RoSA, which defaults to `OFF`.
+
+ When this variable is enabled, build targets created by *Makefile* and *Ninja*
+ generators include calls for clang-tidy. Other generators ignore this option.
+
+ Note that CMake variables `CMAKE__CLANG_TIDY` are set when enabled.
+
+ Settings for clang-tidy are defined by the file `.clang-tidy` in the RoSA
+ source directory.
+
+ Consider the following options when the option is enabled:
+
+ `ROSA_CLANG_TIDY_PATH`
+
+ Custom path for `clang-tidy` executable.
+
+ In order to use clang-tidy, CMake needs to find the `clang-tidy` executable.
+ If `clang-tidy` is available via `PATH`, just leave the option empty
+ -- which is default. Set the absolute path of the directory containing the
+ `clang-tidy` executable otherwise.
+
+ `ROSA_CLANG_TIDY_FIX`
+
+ Apply suggested clang-tidy fixes to the sources, which defaults to `OFF`.
+
+ Enable the option only if you know what you are doing.
+
+
`ROSA_LOG_LEVEL`
Select level of logging to be used, use one of the following valid integer
values.
======== =========
Variable Log Level
======== =========
`0` `ERROR`
`1` `WARNING`
`2` `INFO`
`3` `DEBUG`
`4` `TRACE`
`5` *disabled*
======== =========
Level of logging defaults to *disabled*.
`ROSA_INCLUDE_DOCS`
Generate build targets for RoSA documentation, defaults to `ON`.
Note that the automatic execution of the generated build targets is
controlled by the option `ROSA_BUILD_DOCS`. The actual documentations to
build are controlled by the options `ROSA_ENABLE_DOXYGEN` and
`ROSA_ENABLE_SPHINX`.
`ROSA_BUILD_DOCS`
Build RoSA documentation automatically as part of the build process. The
option defaults to `OFF` and takes effect only if the option
`ROSA_INCLUDE_DOCS` is enabled.
`ROSA_ENABLE_DOXYGEN`
Use *doxygen* to generate RoSA API documentation. The option defaults to `OFF`
and takes effect only if the option `ROSA_INCLUDE_DOCS` is enabled.
Doxygen must be available via `PATH` if the option is enabled.
The following options are also available to tune doxygen:
`ROSA_DOXYGEN_SVG`
Use *svg* instead of *png* files for doxygen graphs. The option defaults to
`OFF` and takes effect if the tool *dot* is available via `PATH` to be used
to generated graph images.
`ROSA_DOXYGEN_EXTERNAL_SEARCH`
Enable doxygen external search, which defatuls to `OFF`.
The following options need to be set if the option is enabled:
`ROSA_DOXYGEN_SEARCHENGINE_URL`
URL to use for external search.
`ROSA_DOXYGEN_SEARCH_MAPPINGS`
Doxygen Search Mappings.
`ROSA_ENABLE_SPHINX`
Use *Sphinx* to generate RoSA documentation. The option defaults to `OFF` and
takes effect only if the option `ROSA_INCLUDE_DOCS` is enabled.
Sphinx must be available via `PATH` if the option is enabled.
The following options are also available to tune Sphinx:
`SPHINX_OUTPUT_HTML`
Output standalone HTML files. The option defaults to `ON`.
`SPHINX_OUTPUT_MAN`
Output man pages for RoSA tools. The option defaults to `ON`.
`SPHINX_WARNINGS_AS_ERRORS`
When building documentation, treat Sphinx warnings as errors. The option
defaults to `ON`.
Building RoSA Step-by-Step
==========================
Building on Linux with Make
---------------------------
Configuring and building the framework on Linux using *Make* is a
straightforward process which does not require performing any tricks. The
framework compiles with *Clang 3.8.0*.
Set C and C++ compilers with the variables `CC` and `CXX`, respectively. Use the
CMake variable `CMAKE_BUILD_TYPE` to set the type of build: `Debug`, `Release`.
Follows an example on building the framework. You need to have RoSA sources on
your computer and Clang executables available via `PATH`.::
rosa-src$ cd ..
$ mkdir rosa-build
$ cd rosa-build
rosa-build$ CC=clang CXX=clang++ cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug -DROSA_LOG_LEVEL="4" ../rosa-src/
[CMake configures and generates without errors]
$ make
[Make builds the project]
You just need to re-run Make in order to re-build the project after changing
the source code and the CMake project. In case the CMake project is changed,
Make automatically calls CMake to update the build project.
Building on Windows with Visual Studio
--------------------------------------
Unfortunately, the native MSVC compiler cannot compile the framework. One needs
to use Clang with Visual Studio in order to build the framework. There are two
alternatives to do that:
* using the *Clang/C2* module for *Visual Studio 2017*,
* using *LLVM for Windows* as an external toolset for Visual Studio
(necessary for older versions of Visual Studio).
For using Visual Studio 2017 -- which would be the preferred way -- one needs to
select *Clang/C2 (experimental)* on the *Individual components* tab in *Visual
Studio Installer*.
For using *LLVM for Windows*, one downloads the official binary release from
http://llvm.org and consults with its documentation. The release provides
integration for Visual Studio versions between 2010 and 2014 (as of LLVM 4.0.0).
Having your build system prepared and RoSA sources fetched to your computer,
configure and build the framework like this:
#. Generate Visual Studio solution with CMake:
#. Start CMake.
#. Define *source directory* and a separate *build directory* in CMake.
#. Click *Configure*.
#. Select the proper *generator* for your version of Visual Studio.
#. Define your optional toolset (argument for `-T`):
* Clang/C2 with VS2017: `v141_clang_c2`.
* LLVM for Windows with older VS: `LLVM-vs`.
#. Click *Finish*.
#. Tune CMake variables as you wish.
* Note that Visual Studio Generators are multi-configuration generators,
hence you cannot set `CMAKE_BUILD_TYPE`. You need to select a
configuration to build in Visual Studio.
#. Click *Generate*.
#. Fix the generated Visual Studio projects (*applies for Clang/C2*):
* The generated projects define `ExceptionHandling` as `Sync`, which is an
invalid value for Clang/C2 and needs to be changed to `Enabled` in all
Visual Studio project files:
* using GNU command line tools::
rosa-build$ find . -name "*.vcxproj" -print|xargs sed -i -e 's/Sync/Enabled/g'
* using PowerShell::
rosa-build> ls -path . -include *.vcxproj -recurse | %{ $f=$_; (gc $f.PSPath) | %{ $_ -replace "Sync", "Enabled" } | sc $f.PSPath }
* Note that the project files need to be fixed every time CMake regenerates
them, which may happen when building the project in Visual Studio in case
you have the CMake project changed in the source directory.
#. Build the framework with Visual Studio:
#. Open the generated `RoSA.sln` from the build directory with Visual
Studio.
#. Build the project `ALL_BUILD`.
You just need to re-build the project in Visual Studio after changing the
source code and the CMake project.
In case the CMake project is changed, Visual Studio automatically calls CMake
the update the build project. Should you use Clang/C2, do not forget to fix the
newly generated Visual Studio project files as described above.