diff options
author | Viktor Szakats <commit@vsz.me> | 2022-07-11 19:41:31 +0000 |
---|---|---|
committer | Viktor Szakats <commit@vsz.me> | 2022-07-11 19:41:31 +0000 |
commit | ca73991774b93471fa09fc84790e101378786470 (patch) | |
tree | ca7a21ed87ccdccbb91e8340e5dc3d8fb1b6318b /CMakeLists.txt | |
parent | 1d5b7b7009dda753b18d00c0198e8624eeedc9c5 (diff) | |
download | curl-ca73991774b93471fa09fc84790e101378786470.tar.gz |
build: improve OS string in CMake and `config-win32.h`
This patch makes CMake fill the "OS string" with the value of
`CMAKE_C_COMPILER_TARGET`, if passed. This typically contains a triplet,
the same we can pass to `./configure` via `--host=`.
For non-CMake, non-autotools, Windows builds, this patch adds the ability
to override the default `OS` value in `lib/config-win32.h`.
With these its possible to get the same OS string across the three build
systems.
This patch supersedes the earlier, partial, CMake-only solution:
435f395f3f8c11eebfcc243ca55ebcc11a19b8b8, thus retiring the
`CURL_OS_SUFFIX` CMake option.
Reviewed-by: Jay Satiro
Closes #9117
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ecb944c7..758e7fefa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,7 +67,11 @@ message(STATUS "curl version=[${CURL_VERSION}]") # SET(PACKAGE_STRING "curl-") # SET(PACKAGE_BUGREPORT "a suitable curl mailing list => https://curl.se/mail/") set(OPERATING_SYSTEM "${CMAKE_SYSTEM_NAME}") -set(OS "\"${CMAKE_SYSTEM_NAME}${CURL_OS_SUFFIX}\"") +if(CMAKE_C_COMPILER_TARGET) + set(OS "\"${CMAKE_C_COMPILER_TARGET}\"") +else() + set(OS "\"${CMAKE_SYSTEM_NAME}\"") +endif() include_directories(${CURL_SOURCE_DIR}/include) |