Issue with CMAKE_OSX_DEPLOYMENT_TARGET being set before a project call
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- cmake, cpp
- Área
- build-system
Línea de trabajo
The default CMAKE_OSX_DEPLOYMENT_TARGET is set in the top-level CMakeLists.txt under an if(APPLE AND NOT DEFINED ...) guard, before the project() call. Read the ordering of that block against project() and the toolchain loading the reporter describes, then check how a value passed by a toolchain file is handled. Done means a toolchain-provided deployment target is respected on macOS, which needs a macOS build to verify, and the fix needs maintainer agreement on whether the default should move or be dropped.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I'm currently preparing/updating the conan recipe for OpenColorIO 2.6.0. While doing that, I saw the following in the CMakeLists.txt:
if(APPLE AND NOT DEFINED CMAKE_OSX_DEPLOYMENT_TARGET)
# The value of this variable should be set prior to the first project() command invocation
# because it may influence configuration of the toolchain and flags.
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version")
endif()
Can't fully see the reasoning for setting this before calling project(). In the case of conan that actually is a downside, as only the call to project will trigger the load of the toolchain, so at the moment when this code runs it has not yet been set, thus 10.15 is set as a deployment target and Xcode fills the output with warnings that I try to target a system that is heavily outdated:
In file included from /Users/ingmar/.conan2/p/b/opencec55f948273cb/b/src/src/OpenColorIO/CPUInfo.cpp:5:
In file included from /Users/ingmar/.conan2/p/b/opencec55f948273cb/b/src/src/OpenColorIO/CPUInfo.h:8:
In file included from /Users/ingmar/.conan2/p/b/opencec55f948273cb/b/src/include/OpenColorIO/../OpenColorIO/OpenColorIO.h:8:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX27.2.sdk/usr/include/c++/v1/cstddef:39:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX27.2.sdk/usr/include/c++/v1/__config:15:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX27.2.sdk/usr/include/c++/v1/__configuration/availability.h:204:4: warning: "The selected platform is no longer supported by libc++." [-W#warnings]
(This is just one, but basically appears for each file.)
Followed by the thus expected linker warning that the other libraries linked in are for a newer SDK:
...
ld: warning: object file (/Users/ingmar/.conan2/p/b/yaml-c29218f011373/p/lib/libyaml-cpp.a[22](parse.cpp.o)) was built for newer 'macOS' version (26.4) than being linked (11.0)
ld: warning: object file (/Users/ingmar/.conan2/p/b/yaml-c29218f011373/p/lib/libyaml-cpp.a[23](parser.cpp.o)) was built for newer 'macOS' version (26.4) than being linked (11.0)
ld: warning: object file (/Users/ingmar/.conan2/p/b/yaml-c29218f011373/p/lib/libyaml-cpp.a[24](regex_yaml.cpp.o)) was built for newer 'macOS' version (26.4) than being linked (11.0)
ld: warning: object file (/Users/ingmar/.conan2/p/b/yaml-c29218f011373/p/lib/libyaml-cpp.a[25](scanner.cpp.o)) was built for newer 'macOS' version (26.4) than being linked (11.0)
ld: warning: object file (/Users/ingmar/.conan2/p/b/yaml-c29218f011373/p/lib/libyaml-cpp.a[26](scanscalar.cpp.o)) was built for newer 'macOS' version (26.4) than being linked (11.0)
ld: warning: object file (/Users/ingmar/.conan2/p/b/yaml-c29218f011373/p/lib/libyaml-cpp.a[27](scantag.cpp.o)) was built for newer 'macOS' version (26.4) than being linked (11.0)
ld: warning: object file (/Users/ingmar/.conan2/p/b/yaml-c29218f011373/p/lib/libyaml-cpp.a[28](scantoken.cpp.o)) was built for newer 'macOS' version (26.4) than being linked (11.0)
ld: warning: object file (/Users/ingmar/.conan2/p/b/yaml-c29218f011373/p/lib/libyaml-cpp.a[29](simplekey.cpp.o)) was built for newer 'macOS' version (26.4) than being linked (11.0)
ld: warning: object file (/Users/ingmar/.conan2/p/b/yaml-c29218f011373/p/lib/libyaml-cpp.a[30](singledocparser.cpp.o)) was built for newer 'macOS' version (26.4) than being linked (11.0)
...
So the description says it is to prevent toolchain problems, here it seems to result in problems that the toolchain set variables are ignored.
This is the block of apple specific settings conan writes into the toolchain:
########## 'apple_system' block #############
# Define Apple architectures, sysroot, deployment target, bitcode, etc
# Set the architectures for which to build.
set(CMAKE_OSX_ARCHITECTURES arm64 CACHE STRING "" FORCE)
# Setting CMAKE_OSX_SYSROOT SDK, when using Xcode generator the name is enough
# but full path is necessary for others
set(CMAKE_OSX_SYSROOT macosx CACHE STRING "" FORCE)
# Setting CMAKE_OSX_DEPLOYMENT_TARGET if "os.version" is defined by the used conan profile
set(CMAKE_OSX_DEPLOYMENT_TARGET "26.4" CACHE STRING "")
# Swift does not derive its target triple from CMAKE_OSX_SYSROOT/CMAKE_OSX_ARCHITECTURES
# the way Clang does, so it is set explicitly. Only a default, any user value wins
if(NOT DEFINED CMAKE_Swift_COMPILER_TARGET)
set(CMAKE_Swift_COMPILER_TARGET "arm64-apple-macosx26.4")
endif()
set(BITCODE "")
set(FOBJC_ARC "")
set(VISIBILITY "")
#Check if Xcode generator is used, since that will handle these flags automagically
if(CMAKE_GENERATOR MATCHES "Xcode")
message(DEBUG "Not setting any manual command-line buildflags, since Xcode is selected as generator.")
else()
string(APPEND CONAN_C_FLAGS " ${BITCODE} ${VISIBILITY}")
string(APPEND CONAN_CXX_FLAGS " ${BITCODE} ${VISIBILITY}")
# Objective-C/C++ specific flags
string(APPEND CONAN_OBJC_FLAGS " ${BITCODE} ${VISIBILITY} ${FOBJC_ARC}")
string(APPEND CONAN_OBJCXX_FLAGS " ${BITCODE} ${VISIBILITY} ${FOBJC_ARC}")
endif()
- Lenguaje dominante
- C++
- Estrellas
- 2.1k
- Forks
- 513
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de AcademySoftwareFoundation/OpenColorIO
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 61/100
AcademySoftwareFoundation/OpenColorIO#2364 · 1 comentario ·
-
Inconsistent run-time library usage for locale handling breaks GPU code generation on some systems.Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
AcademySoftwareFoundation/OpenColorIO#2351 · 2 comentarios ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Build failure on GCC/MinGW (MXE): std::ifstream constructor mismatch with Platform::filenameToUTF()Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Todos los issues de AcademySoftwareFoundation/OpenColorIO
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
godotengine/godot#125913 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
期待增加虚线线条样式Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 94/100
vllm-project/vllm#70568 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
mw00/project-maya#1368 ·
Los mantenedores suelen responder en 2 días