-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch lyra dependency over to a submodule setup like json_struct library. Add cmake support for compiling with vs2019 / vs2022. Add workaround to fix build break with vs2019 and ranges. Add build.ps1 that uses cmake to build all targets for either vs2019 or vs2022. Update readme.md
- Loading branch information
1 parent
5280867
commit 6084a8d
Showing
21 changed files
with
925 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,5 @@ vcpkg_installed | |
/x86DebugCrashDumps | ||
/x86ReleaseCrashDumps | ||
/report.log | ||
/build | ||
CMake/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "libraries/json_struct"] | ||
path = libraries/json_struct | ||
url = https://github.com/jorgen/json_struct | ||
[submodule "libraries/lyra"] | ||
path = libraries/lyra | ||
url = https://github.com/bfgroup/Lyra.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
set(PROJECT_NAME AllocationSetupTests) | ||
|
||
################################################################################ | ||
# Source groups | ||
################################################################################ | ||
set(no_group_source_files | ||
"../RunAllBuildHeapDumpTests.ps1" | ||
"../RunHeapDumpTests.ps1" | ||
) | ||
source_group("" FILES ${no_group_source_files}) | ||
|
||
set(Header_Files | ||
"ResultSet.h" | ||
) | ||
source_group("Header Files" FILES ${Header_Files}) | ||
|
||
set(Source_Files | ||
"AllocationSetupTests.cpp" | ||
) | ||
source_group("Source Files" FILES ${Source_Files}) | ||
|
||
set(ALL_FILES | ||
${no_group_source_files} | ||
${Header_Files} | ||
${Source_Files} | ||
) | ||
|
||
################################################################################ | ||
# Target | ||
################################################################################ | ||
add_executable(${PROJECT_NAME} ${ALL_FILES}) | ||
|
||
use_props(${PROJECT_NAME} "${CMAKE_CONFIGURATION_TYPES}" "${DEFAULT_CXX_PROPS}") | ||
set(ROOT_NAMESPACE AllocationSetupTests) | ||
|
||
set_target_properties(${PROJECT_NAME} PROPERTIES | ||
VS_GLOBAL_KEYWORD "Win32Proj" | ||
) | ||
################################################################################ | ||
# Output directory | ||
################################################################################ | ||
if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "win32") | ||
set_target_properties(${PROJECT_NAME} PROPERTIES | ||
OUTPUT_DIRECTORY_DEBUG "${CMAKE_SOURCE_DIR}/x86/$<CONFIG>/" | ||
OUTPUT_DIRECTORY_RELEASE "${CMAKE_SOURCE_DIR}/x86/$<CONFIG>/" | ||
) | ||
endif() | ||
set_target_properties(${PROJECT_NAME} PROPERTIES | ||
INTERPROCEDURAL_OPTIMIZATION_RELEASE "TRUE" | ||
) | ||
################################################################################ | ||
# Include directories | ||
################################################################################ | ||
target_include_directories(${PROJECT_NAME} PUBLIC | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../libraries;" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/../libraries/lyra/include;" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/.." | ||
) | ||
|
||
################################################################################ | ||
# Compile definitions | ||
################################################################################ | ||
target_compile_definitions(${PROJECT_NAME} PRIVATE | ||
"$<$<CONFIG:Debug>:" | ||
"_DEBUG" | ||
">" | ||
"$<$<CONFIG:Release>:" | ||
"NDEBUG" | ||
">" | ||
"_CONSOLE;" | ||
"UNICODE;" | ||
"_UNICODE" | ||
) | ||
|
||
################################################################################ | ||
# Compile and link options | ||
################################################################################ | ||
if(MSVC) | ||
target_compile_options(${PROJECT_NAME} PRIVATE | ||
$<$<CONFIG:Release>: | ||
/Oi; | ||
/Gy | ||
> | ||
/permissive-; | ||
/std:c++latest; | ||
/sdl; | ||
/W4; | ||
/WX; | ||
${DEFAULT_CXX_DEBUG_INFORMATION_FORMAT}; | ||
${DEFAULT_CXX_EXCEPTION_HANDLING} | ||
) | ||
target_link_options(${PROJECT_NAME} PRIVATE | ||
$<$<CONFIG:Debug>: | ||
/INCREMENTAL | ||
> | ||
$<$<CONFIG:Release>: | ||
/OPT:REF; | ||
/OPT:ICF; | ||
/INCREMENTAL:NO | ||
> | ||
/DEBUG; | ||
/SUBSYSTEM:CONSOLE | ||
) | ||
endif() | ||
|
||
################################################################################ | ||
# Dependencies | ||
################################################################################ | ||
add_dependencies(${PROJECT_NAME} | ||
DbgHelpUtils | ||
) | ||
|
||
# Link with other targets. | ||
target_link_libraries(${PROJECT_NAME} PRIVATE | ||
DbgHelpUtils | ||
) | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
cmake_minimum_required(VERSION 3.15.0 FATAL_ERROR) | ||
|
||
set(CMAKE_SYSTEM_VERSION 10.0 CACHE STRING "" FORCE) | ||
|
||
project(DbgHelpUtils CXX) | ||
|
||
################################################################################ | ||
# Set target arch type if empty. Visual studio solution generator provides it. | ||
################################################################################ | ||
if(NOT CMAKE_VS_PLATFORM_NAME) | ||
set(CMAKE_VS_PLATFORM_NAME "x64") | ||
endif() | ||
message("${CMAKE_VS_PLATFORM_NAME} architecture in use") | ||
|
||
if(NOT ("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "x64" | ||
OR "${CMAKE_VS_PLATFORM_NAME}" STREQUAL "win32")) | ||
message(FATAL_ERROR "${CMAKE_VS_PLATFORM_NAME} arch is not supported!") | ||
endif() | ||
|
||
################################################################################ | ||
# Global configuration types | ||
################################################################################ | ||
set(CMAKE_CONFIGURATION_TYPES | ||
"Debug" | ||
"Release" | ||
CACHE STRING "" FORCE | ||
) | ||
|
||
################################################################################ | ||
# Global compiler options | ||
################################################################################ | ||
if(MSVC) | ||
# remove default flags provided with CMake for MSVC | ||
set(CMAKE_CXX_FLAGS "") | ||
set(CMAKE_CXX_FLAGS_DEBUG "") | ||
set(CMAKE_CXX_FLAGS_RELEASE "") | ||
endif() | ||
|
||
################################################################################ | ||
# Global linker options | ||
################################################################################ | ||
if(MSVC) | ||
# remove default flags provided with CMake for MSVC | ||
set(CMAKE_EXE_LINKER_FLAGS "") | ||
set(CMAKE_MODULE_LINKER_FLAGS "") | ||
set(CMAKE_SHARED_LINKER_FLAGS "") | ||
set(CMAKE_STATIC_LINKER_FLAGS "") | ||
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS}") | ||
set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "${CMAKE_MODULE_LINKER_FLAGS}") | ||
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS}") | ||
set(CMAKE_STATIC_LINKER_FLAGS_DEBUG "${CMAKE_STATIC_LINKER_FLAGS}") | ||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS}") | ||
set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS}") | ||
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS}") | ||
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS}") | ||
endif() | ||
|
||
################################################################################ | ||
# Nuget packages function stub. | ||
################################################################################ | ||
function(use_package TARGET PACKAGE VERSION) | ||
message(WARNING "No implementation of use_package. Create yours. " | ||
"Package \"${PACKAGE}\" with version \"${VERSION}\" " | ||
"for target \"${TARGET}\" is ignored!") | ||
endfunction() | ||
|
||
################################################################################ | ||
# Common utils | ||
################################################################################ | ||
include(CMake/Utils.cmake) | ||
|
||
################################################################################ | ||
# Additional Global Settings(add specific info there) | ||
################################################################################ | ||
include(CMake/GlobalSettingsInclude.cmake OPTIONAL) | ||
|
||
################################################################################ | ||
# Use solution folders feature | ||
################################################################################ | ||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
|
||
################################################################################ | ||
# Sub-projects | ||
################################################################################ | ||
add_subdirectory(AllocationSetupTests) | ||
add_subdirectory(DbgHelpUtils) | ||
add_subdirectory(MiniDumper) | ||
add_subdirectory(ValidateHeapEntries) | ||
|
Oops, something went wrong.