Skip to content

Commit

Permalink
ccache, fix MSVC compile options, ARES_VERSION_OVERRIDE, add .gitattr…
Browse files Browse the repository at this point in the history
…ibutes
  • Loading branch information
jcm93 committed Nov 2, 2024
1 parent 1cae50b commit d5c9e6b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
11 changes: 11 additions & 0 deletions .gersemirc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/BlankSpruce/gersemi/master/gersemi/configuration.schema.json

color: false
definitions: [ares/CMakeLists.txt]
line_length: 120
indent: 2
list_expansion: favour-inlining
quiet: false
unsafe: false
warn_about_unknown_commands: false
workers: 10
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
!.editorconfig
!.gitmodules
!.gitignore
!.gitattributes
!.gersemirc
!buildspec.json
!CMakeLists.txt
!CMakePresets.json
Expand Down
8 changes: 4 additions & 4 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"ARES_PROFILE_ACCURACY": false,
"ENABLE_VULKAN": true,
"ARES_BUILD_LOCAL": true,
"ENABLE_CCACHE": false
"ENABLE_CCACHE": true
}
},
{
Expand All @@ -33,7 +33,7 @@
"ARES_CODESIGN_IDENTITY": {"type": "STRING", "value": "$penv{CODESIGN_IDENT}"},
"ARES_CODESIGN_TEAM": {"type": "STRING", "value": "$penv{CODESIGN_TEAM}"},
"ENABLE_COMPILER_TRACE": true,
"ENABLE_CCACHE": false
"ENABLE_CCACHE": true
}
},
{
Expand All @@ -50,7 +50,7 @@
"generator": "Visual Studio 17 2022",
"toolset": "ClangCL",
"cacheVariables": {
"ENABLE_CCACHE": false
"ENABLE_CCACHE": true
}
},
{
Expand All @@ -66,7 +66,7 @@
"binaryDir": "${sourceDir}/build_msvc",
"generator": "Visual Studio 17 2022",
"cacheVariables": {
"ENABLE_CCACHE": false
"ENABLE_CCACHE": true
}
}
],
Expand Down
2 changes: 1 addition & 1 deletion cmake/common/versionconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if(NOT DEFINED ARES_VERSION_OVERRIDE AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.gi
string(REGEX REPLACE "^v([0-9]+)(.*)$" "\\1.0.0\\2" _ares_version "${ARES_VERSION}")
string(REGEX REPLACE "(-[0-9]+-.*|-.+)" "" ARES_VERSION_CANONICAL "${_ares_version}")
elseif(DEFINED ARES_VERSION_OVERRIDE)
set(ARES_VERSION ARES_VERSION_OVERRIDE)
set(ARES_VERSION ${ARES_VERSION_OVERRIDE})
endif()

unset(_ares_version)
7 changes: 4 additions & 3 deletions cmake/windows/compilerconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ add_compile_definitions(_WIN32_WINNT=0x0601) #global

set(
_ares_msvc_cxx_options
/W2
/MP
/Zc:__cplusplus
/utf-8
Expand All @@ -58,7 +59,7 @@ set(
)

if(MSVC)
if(CMAKE_CXX_COMPILER_ID STREQUAL MSVC)
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
add_compile_options(
"$<$<COMPILE_LANGUAGE:C,CXX>:${_ares_msvc_cxx_options}>"
)
Expand All @@ -70,7 +71,7 @@ if(MSVC)
if(CMAKE_COMPILE_WARNING_AS_ERROR)
add_link_options(/WX)
endif()
elseif(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(
"$<$<COMPILE_LANGUAGE:C>:${_ares_clang_c_options}>"
"$<$<COMPILE_LANGUAGE:CXX>:${_ares_clang_cxx_options}>"
Expand All @@ -81,7 +82,7 @@ if(MSVC)
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT ProgramDatabase)
else()
# msys2
if(CMAKE_CXX_COMPILER_ID STREQUAL Clang)
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_compile_options(
"$<$<COMPILE_LANGUAGE:C>:${_ares_clang_c_options}>"
"$<$<COMPILE_LANGUAGE:CXX>:${_ares_clang_cxx_options}>"
Expand Down

0 comments on commit d5c9e6b

Please sign in to comment.