This is an automated email from the ASF dual-hosted git repository.
aboda pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
The following commit(s) were added to refs/heads/main by this push:
new 6b210f2 MINIFICPP-1310 Fix the CMakeSettings.json file used by Visual
Studio
6b210f2 is described below
commit 6b210f2885ad8ee2d6b890afa4052b72466ca4ea
Author: Ferenc Gerlits <[email protected]>
AuthorDate: Mon Jul 27 14:10:33 2020 +0200
MINIFICPP-1310 Fix the CMakeSettings.json file used by Visual Studio
* Change build type to 32-bit RelWithDebInfo
* Copy all the variable settings from win_build_vs.bat
* Set up the search path for mc.exe correctly (mixing individual items and
lists doesn't work)
* Update Windows.md
MINIFICPP-1310 Change STRICT_GSL_CHECKS to ON
Signed-off-by: Arpad Boda <[email protected]>
This closes #854
---
CMakeSettings.json | 76 ++++++++++++++++++++---------------------
Windows.md | 13 ++++---
cmake/FindMessageCompiler.cmake | 23 ++++++-------
3 files changed, 57 insertions(+), 55 deletions(-)
diff --git a/CMakeSettings.json b/CMakeSettings.json
index 96f2694..4ce388e 100644
--- a/CMakeSettings.json
+++ b/CMakeSettings.json
@@ -2,41 +2,45 @@
// See https://go.microsoft.com//fwlink//?linkid=834763 for more information
about this file.
"configurations": [
{
- "name": "x64-Release",
- "generator": "Visual Studio 15 2017 Win64",
+ "name": "x86-RelWithDebInfo",
+ "generator": "Visual Studio 15 2017",
"configurationType": "RelWithDebInfo",
- "inheritEnvironments": [ "msvc_x64_x64" ],
+ "inheritEnvironments": [ "msvc_x86" ],
"buildRoot":
"${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\build\\${name}",
"installRoot":
"${env.USERPROFILE}\\CMakeBuilds\\${workspaceHash}\\install\\${name}",
"cmakeCommandArgs": "",
- "buildCommandArgs": "-m -v:minimal",
+ "buildCommandArgs": "",
"variables": [
{
- "name": "OPENSSL_OFF",
+ "name": "INSTALLER_MERGE_MODULES",
"value": "OFF"
},
{
- "name": "CMAKE_BUILD_TYPE",
+ "name": "ENABLE_SQL",
+ "value": "OFF"
+ },
+ {
+ "name": "CMAKE_BUILD_TYPE_INIT",
"value": "RelWithDebInfo"
},
{
- "name": "USE_SYSTEM_OPENSSL",
- "value": "OFF"
+ "name": "WIN32",
+ "value": "WIN32"
},
{
- "name": "PORTABLE",
- "value": "ON"
+ "name": "ENABLE_LIBRDKAFKA",
+ "value": "OFF"
},
{
- "name": "USE_SYSTEM_ZLIB",
+ "name": "ENABLE_JNI",
"value": "OFF"
},
{
- "name": "DISABLE_CONTROLLER",
- "value": "TRUE"
+ "name": "OPENSSL_OFF",
+ "value": "OFF"
},
{
- "name": "USE_SYSTEM_UUID",
+ "name": "ENABLE_COAP",
"value": "OFF"
},
{
@@ -44,55 +48,51 @@
"value": "OFF"
},
{
- "name": "FORCE_WINDOWS",
+ "name": "DISABLE_CONTROLLER",
"value": "ON"
},
{
- "name": "DISABLE_ROCKSDB",
- "value": "FALSE"
- },
- {
- "name": "FAIL_ON_WARNINGS",
- "value": "OFF"
- },
- {
- "name": "ENABLE_WEL",
- "value": "TRUE"
+ "name": "BUILD_ROCKSDB",
+ "value": "ON"
},
{
- "name": "ENABLE_SQL",
- "value": "TRUE"
+ "name": "FORCE_WINDOWS",
+ "value": "ON"
},
{
- "name": "ENABLE_LIBRDKAFKA",
+ "name": "USE_SYSTEM_UUID",
"value": "OFF"
},
{
- "name": "DISABLE_CURL",
+ "name": "DISABLE_LIBARCHIVE",
"value": "OFF"
},
{
- "name": "FORCE_WINDOWS",
+ "name": "DISABLE_SCRIPTING",
"value": "ON"
},
{
- "name": "ENABLE_COAP",
- "value": "OFF"
+ "name": "EXCLUDE_BOOST",
+ "value": "ON"
},
{
- "name": "DISABLE_LIBARCHIVE",
+ "name": "ENABLE_WEL",
"value": "TRUE"
},
{
- "name": "DISABLE_SCRIPTING",
- "value": "TRUE"
+ "name": "FAIL_ON_WARNINGS",
+ "value": "OFF"
},
{
- "name": "EXCLUDE_BOOST",
- "value": "TRUE"
+ "name": "SKIP_TESTS",
+ "value": "OFF"
+ },
+ {
+ "name": "STRICT_GSL_CHECKS",
+ "value": "ON"
}
],
"ctestCommandArgs": ""
}
]
-}
\ No newline at end of file
+}
diff --git a/Windows.md b/Windows.md
index 4726628..d453955 100644
--- a/Windows.md
+++ b/Windows.md
@@ -36,15 +36,17 @@ in a much smaller memory footprint and consume fewer
resources. If your systems
## Building with Visual Studio
-In order to support Visual Studio you must install [plugins capable of
building
CMake](https://devblogs.microsoft.com/cppblog/cmake-support-in-visual-studio/).
We also advise
+Make sure your Visual Studio installation includes the "Visual C++ tools for
CMake" and "Visual C++ ATL for x86 and x64" options.
+You can also add these after installation using the Visual Studio Installer
app. We also advise
installing WiX and Visual Studio Command Prompt via the marketplace. To do
this please go to the Tools Menu, followed by Extensions and Updates. Once the
popup displays you
may install additional features from Online sources in the Online menu.
A file named CMakeSettings.json provides the CMake configuration.
CMake must generate its cache, under Cache in the CMake Menu. After that is
complete go to 'Build Only' under the CMake menu. Due to limitations in Visual
Studio's CMake support, it is advised
-that you build `minifi.lib` then `minifiexe` targets. Once you have built
these targets, you may use the `cpack` command to build your MSI. If you are
building with JNI functionality the MSI will be
-significantly larger ( about 160 MB ) since it contains the base NARs to run
the standard set of Apache NiFi processors.
+that you build `minifi.lib` then `minifi.exe` targets. `Build All` works,
too, but it takes much longer.
+Once you have built these targets, you may use the `cpack` command to build
your MSI. If you are building with JNI functionality the MSI will be
+significantly larger (about 160 MB) since it contains the base NARs to run the
standard set of Apache NiFi processors.
## Building via the build script
@@ -60,6 +62,7 @@ After the build directory it will take optional parameters
modifying the CMake c
| /J | Enables JNI |
| /64 | Creates 64-bit build instead of a 32-bit one |
| /D | Builds RelWithDebInfo build instead of Release |
+| /CI | Sets STRICT_GSL_CHECKS to AUDIT |
Examples:
- 32-bit build with kafka, disabling tests, enabling MSI creation:
`win_build_vs.bat build32 /T /K /P`
@@ -78,8 +81,8 @@ A basic working CMake configuration can be inferred from the
`win_build_vs.bat`.
```
mkdir build
cd build
-cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE_INIT=Release
-DCMAKE_BUILD_TYPE=Release -DWIN32=WIN32 -DENABLE_LIBRDKAFKA=OFF
-DENABLE_JNI=OFF -DOPENSSL_OFF=OFF -DENABLE_COAP=OFF -DUSE_SHARED_LIBS=OFF
-DDISABLE_CONTROLLER=ON -DBUILD_ROCKSDB=ON -DFORCE_WINDOWS=ON
-DUSE_SYSTEM_UUID=OFF -DDISABLE_LIBARCHIVE=ON -DDISABLE_SCRIPTING=ON
-DEXCLUDE_BOOST=ON -DENABLE_WEL=TRUE -DFAIL_ON_WARNINGS=OFF -DSKIP_TESTS=OFF ..
-msbuild /m nifi-minifi-cpp.sln /property:Configuration=Release
/property:Platform=x64
+cmake -G "Visual Studio 15 2017" -DINSTALLER_MERGE_MODULES=OFF
-DENABLE_SQL=OFF -DCMAKE_BUILD_TYPE_INIT=Release -DCMAKE_BUILD_TYPE=Release
-DWIN32=WIN32 -DENABLE_LIBRDKAFKA=OFF -DENABLE_JNI=OFF -DOPENSSL_OFF=OFF
-DENABLE_COAP=OFF -DUSE_SHARED_LIBS=OFF -DDISABLE_CONTROLLER=ON
-DBUILD_ROCKSDB=ON -DFORCE_WINDOWS=ON -DUSE_SYSTEM_UUID=OFF
-DDISABLE_LIBARCHIVE=OFF -DDISABLE_SCRIPTING=ON -DEXCLUDE_BOOST=ON
-DENABLE_WEL=TRUE -DFAIL_ON_WARNINGS=OFF -DSKIP_TESTS=OFF ..
+msbuild /m nifi-minifi-cpp.sln /property:Configuration=Release
/property:Platform=Win32
copy main\Release\minifi.exe main\
cpack
ctest -C Release
diff --git a/cmake/FindMessageCompiler.cmake b/cmake/FindMessageCompiler.cmake
index 22c1a70..4f930a3 100644
--- a/cmake/FindMessageCompiler.cmake
+++ b/cmake/FindMessageCompiler.cmake
@@ -21,29 +21,28 @@ if (WIN32)
get_filename_component(kit10wow_dir
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows Kits\\Installed
Roots;KitsRoot10]" REALPATH)
file(GLOB kit10_list ${kit10_dir}/bin/10.* ${kit10wow_dir}/bin/10.*)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(env_bindir "$ENV{WindowsSdkVerBinPath}/x64")
- set(sdk_bindir "${sdk_dir}/bin/x64")
- set(kit_bindir "${kit_dir}/bin/x64")
- set(kit81_bindir "${kit81_dir}/bin/x64")
+ list(APPEND tools_bin_dir_list "$ENV{WindowsSdkVerBinPath}/x64")
+ list(APPEND tools_bin_dir_list "${sdk_dir}/bin/x64")
+ list(APPEND tools_bin_dir_list "${kit_dir}/bin/x64")
+ list(APPEND tools_bin_dir_list "${kit81_dir}/bin/x64")
foreach (tmp_elem ${kit10_list})
if (IS_DIRECTORY ${tmp_elem})
- list(APPEND kit10_bindir "${tmp_elem}/x64")
+ list(APPEND tools_bin_dir_list "${tmp_elem}/x64")
endif()
endforeach()
else ()
- set(env_bindir "$ENV{WindowsSdkVerBinPath}/x86")
- set(sdk_bindir "${sdk_dir}/bin")
- set(kit_bindir "${kit_dir}/bin/x86")
- set(kit81_bindir "${kit81_dir}/bin/x86")
+ list(APPEND tools_bin_dir_list "$ENV{WindowsSdkVerBinPath}/x86")
+ list(APPEND tools_bin_dir_list "${sdk_dir}/bin")
+ list(APPEND tools_bin_dir_list "${kit_dir}/bin/x86")
+ list(APPEND tools_bin_dir_list "${kit81_dir}/bin/x86")
foreach (tmp_elem ${kit10_list})
if (IS_DIRECTORY ${tmp_elem})
- list(APPEND kit10_bindir "${tmp_elem}/x86")
+ list(APPEND tools_bin_dir_list "${tmp_elem}/x86")
endif()
endforeach()
endif ()
endif ()
- find_program(CMAKE_MC_COMPILER mc.exe HINTS "${env_bindir}"
"${sdk_bindir}" "${kit_bindir}" "${kit81_bindir}" "${kit10_bindir}"
- DOC "path to message compiler")
+ find_program(CMAKE_MC_COMPILER mc.exe HINTS ${tools_bin_dir_list} DOC
"path to message compiler")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MessageCompiler