Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The install target fails to install some headers #292

Open
yurivict opened this issue Jan 23, 2023 · 3 comments
Open

The install target fails to install some headers #292

yurivict opened this issue Jan 23, 2023 · 3 comments
Assignees
Labels
cmake CMake related issue help wanted Extra attention is needed

Comments

@yurivict
Copy link

These headers are installed by the FreeBSD port manually:

Error: Missing: include/cpu_features/cpuinfo_aarch64.h
Error: Missing: include/cpu_features/cpuinfo_arm.h
Error: Missing: include/cpu_features/cpuinfo_mips.h
Error: Missing: include/cpu_features/cpuinfo_ppc.h
Error: Missing: include/cpu_features/internal/hwcaps.h

Should they be installed by the project?

Version: 0.7.0
FreeBSD 13.1

@toor1245
Copy link
Contributor

@Mizux

@Mizux Mizux self-assigned this Jan 24, 2023
@Mizux Mizux added help wanted Extra attention is needed cmake CMake related issue labels Jan 24, 2023
@Mizux
Copy link
Collaborator

Mizux commented Jan 24, 2023

  1. Our install should only install header files of the target aka aarch64 headers won't be installed for a x86_64 build.

  2. This cmake install rule define the headers install destination...

    cpu_features/CMakeLists.txt

    Lines 230 to 232 in 4590768

    install(TARGETS cpu_features list_cpu_features
    EXPORT CpuFeaturesTargets
    PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cpu_features

  3. I'm not sure we "flag" our headers as PUBLIC_HEADER, so it is possible that none of our headers (even the required one in 1)) are installed, on my way to test and fix it if needed...
    EDIT: seems to work as expected...

    set_target_properties(cpu_features PROPERTIES PUBLIC_HEADER "${CPU_FEATURES_HDRS}")

    add_cpu_features_headers_and_sources(CPU_FEATURES_HDRS CPU_FEATURES_SRCS)

    macro(add_cpu_features_headers_and_sources HDRS_LIST_NAME SRCS_LIST_NAME)
    list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpu_features_macros.h)
    list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpu_features_cache_info.h)
    file(GLOB IMPL_SOURCES CONFIGURE_DEPENDS "${PROJECT_SOURCE_DIR}/src/impl_*.c")
    list(APPEND ${SRCS_LIST_NAME} ${IMPL_SOURCES})
    if(PROCESSOR_IS_MIPS)
    list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_mips.h)
    elseif(PROCESSOR_IS_ARM)
    list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_arm.h)
    elseif(PROCESSOR_IS_AARCH64)
    list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_aarch64.h)
    elseif(PROCESSOR_IS_X86)
    list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_x86.h)
    list(APPEND ${SRCS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/internal/cpuid_x86.h)
    list(APPEND ${SRCS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/internal/windows_utils.h)
    elseif(PROCESSOR_IS_POWER)
    list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_ppc.h)
    elseif(PROCESSOR_IS_S390X)
    list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_s390x.h)
    elseif(PROCESSOR_IS_RISCV)
    list(APPEND ${HDRS_LIST_NAME} ${PROJECT_SOURCE_DIR}/include/cpuinfo_riscv.h)
    else()
    message(FATAL_ERROR "Unsupported architectures ${CMAKE_SYSTEM_PROCESSOR}")
    endif()
    endmacro()

@yurivict I would say these headers are unneeded and should be removed from the FreeBSD recipe or you need to flag them for install according to the target machine targeted
i.e. Try to see if your FreeBSD pkg build recipe have conditional install rule according to the targeted CPU arch...

@ghost
Copy link

ghost commented Feb 1, 2023

Hello sir ,
I am new to open source contribution.
I already know java , my tech stacks & tools includes C, C++ , Python , Java, JavaScript , HTML , CSS , SQL , Bootstrap, ReactJS, ExpressJS, NodeJS & Git . I need a little help from your side to contribute to these amazing projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmake CMake related issue help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants