diff --git a/README.build.txt b/README.build.txt index 7b53864..0632af2 100644 --- a/README.build.txt +++ b/README.build.txt @@ -1,107 +1,109 @@ =========================== Building the RoSA Framework =========================== General notes: ------------- The provided CMake project supports only out-of-tree builds, i.e. one needs to create a build directory and run CMake in that using the source directory path as argument. CMake Variables: --------------- Beyond the usual CMake variables, the following project-related options are available: * ROSA_INCLUDE_TOOLS, defaults to ON * ROSA_INCLUDE_EXAMPLES, defaults to ON * ROSA_ENABLE_PEDANTIC, defaults to ON * ROSA_ENABLE_ASSERTIONS, defaults to ON only for debug builds, and its value is respected only for non-debug builds * ROSA_LOG_LEVEL, defaults to none, use a valid integer value to enable logging ** 0 - ERROR ** 1 - WARNING ** 2 - INFO ** 3 - DEBUG ** 4 - TRACE Build on Linux with Make: ------------------------ 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 your 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 accordingly. Build 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 this: * using the Clang/C2 module for Visual Studio 2017, * installing LLVM for Windows and using it 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, build the framework like this: * Generate Visual Studio solution with CMake ** Define the 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 will *** 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 ExceptionHandling option in the generated projects is 'Sync', which is an invalid value for Clang/C2 and needs to be changed to 'Enabled' in all Visual Studio project files *** with GNU tools rosa-build$ find . -name "*.vcxproj" -print|xargs sed -i -e 's/Sync/Enabled/g' -*** with PowerShell +*** with PowerShell (works in Windows 10) rosa-build> ls *.vcxproj -rec | %{ $f=$_; (gc $f.PSPath) | %{ $_ -replace "Sync", "Enabled" } | sc $f.PSPath } +*** with PowerShell (e.g. Windows 7) +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 accordingly. Do not forget to fix the newly generated Visual Studio project files if you use Clang/C2 with Visual Studio 2017.