diff --git a/CMakeLists.txt b/CMakeLists.txt index 3088618402..bb5252df81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16.0) +cmake_minimum_required(VERSION 3.17.0) # Avoid Warning About DOWNLOAD_EXTRACT_TIMESTAMP if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24.0) @@ -43,8 +43,8 @@ if(BUILD_NATIVE_COMPONENTS) # Arguments set(ARM_OPTIONS "${MCPI_OPTIONS}") list(APPEND ARM_OPTIONS "-DMCPI_BUILD_MODE:STRING=arm") - macro(add_arm_option option) - endmacro() + list(APPEND ARM_OPTIONS "-DCMAKE_INSTALL_MESSAGE:STRING=NEVER") + list(APPEND ARM_OPTIONS "-DCMAKE_INSTALL_PREFIX:PATH=/install") if(NOT MCPI_USE_PREBUILT_ARMHF_TOOLCHAIN) if(DEFINED CMAKE_TOOLCHAIN_FILE) list(APPEND ARM_OPTIONS "-DCMAKE_TOOLCHAIN_FILE:FILEPATH=${CMAKE_TOOLCHAIN_FILE}") @@ -57,11 +57,19 @@ if(BUILD_NATIVE_COMPONENTS) DOWNLOAD_COMMAND "" SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CMAKE_CACHE_ARGS ${ARM_OPTIONS} + INSTALL_COMMAND "${CMAKE_COMMAND}" "-E" "rm" "-rf" "/install" + COMMAND + "${CMAKE_COMMAND}" "-E" "env" + "DESTDIR=" + "${CMAKE_COMMAND}" "--install" "" USES_TERMINAL_CONFIGURE TRUE USES_TERMINAL_BUILD TRUE USES_TERMINAL_INSTALL TRUE BUILD_ALWAYS TRUE ) + # Install + ExternalProject_Get_Property(arm-components INSTALL_DIR) + install(DIRECTORY "${INSTALL_DIR}/install/${MCPI_INSTALL_DIR}/" DESTINATION "${MCPI_INSTALL_DIR}") endif() # Required Compile Flags diff --git a/dependencies/qemu/CMakeLists.txt b/dependencies/qemu/CMakeLists.txt index 3030832802..3cf3c4c037 100644 --- a/dependencies/qemu/CMakeLists.txt +++ b/dependencies/qemu/CMakeLists.txt @@ -13,11 +13,15 @@ endif() # Build include(ExternalProject) +set(pkgconfig_env "") +if(DEFINED ENV{PKG_CONFIG_LIBDIR}) + set(pkgconfig_env "PKG_CONFIG_LIBDIR=$ENV{PKG_CONFIG_LIBDIR}") +endif() ExternalProject_Add(qemu URL "${CMAKE_CURRENT_SOURCE_DIR}/../../archives/qemu-${QEMU_VERSION}.tar.xz" CONFIGURE_COMMAND "${CMAKE_COMMAND}" "-E" "env" - "PKG_CONFIG_LIBDIR=$ENV{PKG_CONFIG_LIBDIR}" + ${pkgconfig_env} "CFLAGS=-s" "CXXFLAGS=-s" "/configure" diff --git a/libreborn/CMakeLists.txt b/libreborn/CMakeLists.txt index 59bfa3ff09..208a4f3482 100644 --- a/libreborn/CMakeLists.txt +++ b/libreborn/CMakeLists.txt @@ -36,13 +36,11 @@ endif() # Fake LibPNG To Satisy Symbol Versioning Requirement if(BUILD_ARM_COMPONENTS) - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/fake-libpng.c" "") - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/fake-libpng.vers" "PNG12_0 { global: *; };") - add_library(fake-libpng SHARED "${CMAKE_CURRENT_BINARY_DIR}/fake-libpng.c") + add_library(fake-libpng SHARED src/fake-libpng/empty.c) set_target_properties(fake-libpng PROPERTIES OUTPUT_NAME "png12" SOVERSION 0 - LINK_OPTIONS "LINKER:--version-script=${CMAKE_CURRENT_BINARY_DIR}/fake-libpng.vers" + LINK_OPTIONS "LINKER:--version-script=${CMAKE_CURRENT_SOURCE_DIR}/src/fake-libpng/empty.vers" ) # Install install(TARGETS fake-libpng DESTINATION "${MCPI_LIB_DIR}") diff --git a/libreborn/src/fake-libpng/empty.c b/libreborn/src/fake-libpng/empty.c new file mode 100644 index 0000000000..e69de29bb2 diff --git a/libreborn/src/fake-libpng/empty.vers b/libreborn/src/fake-libpng/empty.vers new file mode 100644 index 0000000000..869d3cc6e4 --- /dev/null +++ b/libreborn/src/fake-libpng/empty.vers @@ -0,0 +1 @@ +PNG12_0 { global: *; };