Skip to content

Commit

Permalink
enable ccache by default; fix msvc compile options and ARES_VERSION_O…
Browse files Browse the repository at this point in the history
…VERRIDE
  • Loading branch information
jcm93 committed Nov 1, 2024
1 parent 1cae50b commit 0e46735
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
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 0e46735

Please sign in to comment.