Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 committed Mar 15, 2023
0 parents commit 6fabc95
Show file tree
Hide file tree
Showing 8 changed files with 872 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.vs/
out/
33 changes: 33 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
cmake_minimum_required(VERSION 3.23 FATAL_ERROR)

# Enable Hot Reload for MSVC compilers if supported.
if(POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()

project(nfs-save-rehash C CXX)

file(GLOB_RECURSE SRC_FILES CONFIGURE_DEPENDS "src/*.cpp" "src/*.c")
file(GLOB_RECURSE HEADERS CONFIGURE_DEPENDS "src/*.h")
add_executable(${PROJECT_NAME} ${SRC_FILES})
target_sources(${PROJECT_NAME} PRIVATE FILE_SET HEADERS
BASE_DIRS "src"
FILES "${HEADERS}")
if(WIN32)
target_sources(${PROJECT_NAME} PRIVATE "src/version.rc")
endif()

set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD_REQUIRED ON)
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden)

if(MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE "/W3" "/Zc:throwingNew" "/EHsc")
endif()

install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin)
if(CMAKE_CXX_LINKER_SUPPORTS_PDB)
install(FILES $<TARGET_PDB_FILE:${PROJECT_NAME}> DESTINATION bin OPTIONAL)
endif()
115 changes: 115 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"version": 3,
"configurePresets": [
{
"name": "base",
"hidden": true,
"binaryDir": "${sourceDir}/out/build/${presetName}",
"installDir": "${sourceDir}/out/install/${presetName}"
},
{
"name": "windows-base",
"hidden": true,
"inherits": "base",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_C_COMPILER": "cl.exe",
"CMAKE_CXX_COMPILER": "cl.exe"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "unix-base",
"hidden": true,
"inherits": "base",
"generator": "Unix Makefiles",
"condition": {
"type": "notEquals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "x64-debug",
"hidden": true,
"architecture": {
"value": "x64",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "x64-debug-windows",
"displayName": "x64 Debug",
"inherits": [ "x64-debug", "windows-base" ]
},
{
"name": "x64-debug-unix",
"displayName": "x64 Debug",
"inherits": [ "x64-debug", "unix-base" ]
},
{
"name": "x64-release",
"hidden": true,
"inherits": "x64-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "x64-release-windows",
"displayName": "x64 Release",
"inherits": [ "x64-release", "windows-base" ]
},
{
"name": "x64-release-unix",
"displayName": "x64 Debug",
"inherits": [ "x64-release", "unix-base" ]
},
{
"name": "x86-debug",
"hidden": true,
"architecture": {
"value": "x86",
"strategy": "external"
},
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "x86-debug-windows",
"displayName": "x86 Debug",
"inherits": [ "x86-debug", "windows-base" ]
},
{
"name": "x86-debug-unix",
"displayName": "x86 Debug",
"inherits": [ "x86-debug", "unix-base" ]
},
{
"name": "x86-release",
"hidden": true,
"inherits": "x86-debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "x86-release-windows",
"displayName": "x86 Release",
"inherits": [ "x86-release", "windows-base" ]
},
{
"name": "x86-release-unix",
"displayName": "x86 Debug",
"inherits": [ "x86-release", "unix-base" ]
}
]
}
Loading

0 comments on commit 6fabc95

Please sign in to comment.