CICD
This commit is contained in:
SoftFever 2023-01-12 22:55:50 +08:00 committed by GitHub
parent 43f4288fdc
commit 96c861f906
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 581 additions and 84 deletions

41
deps/CMakeLists.txt vendored
View file

@ -40,6 +40,25 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
option(DEP_WX_GTK3 "Build wxWidgets against GTK3" OFF)
endif()
set(IS_CROSS_COMPILE FALSE)
if (APPLE)
set(CMAKE_FIND_FRAMEWORK LAST)
set(CMAKE_FIND_APPBUNDLE LAST)
list(FIND CMAKE_OSX_ARCHITECTURES ${CMAKE_SYSTEM_PROCESSOR} _arch_idx)
message(STATUS "prusaslicer_add_cmake_project for Apple")
if (CMAKE_OSX_ARCHITECTURES AND _arch_idx LESS 0)
message(STATUS "prusaslicer_add_cmake_project for Apple crosscompiling")
set(IS_CROSS_COMPILE TRUE)
set(CMAKE_CXX_COMPILER_ID "Clang")
string(REPLACE ";" "$<SEMICOLON>" CMAKE_OSX_ARCHS "${CMAKE_OSX_ARCHITECTURES}")
set(_cmake_osx_arch -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHS})
set(_cmake_args_osx_arch CMAKE_ARGS -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHS})
message(STATUS "Detect Cross-compilation. Will build for target ${CMAKE_OSX_ARCHS}" )
endif ()
endif ()
# On developer machines, it can be enabled to speed up compilation and suppress warnings coming from IGL.
# FIXME:
# Enabling this option is not safe. IGL will compile itself with its own version of Eigen while
@ -77,6 +96,7 @@ function(bambustudio_add_cmake_project projectname)
set(_build_j "/m")
endif ()
if (NOT IS_CROSS_COMPILE OR NOT APPLE)
ExternalProject_Add(
dep_${projectname}
EXCLUDE_FROM_ALL ON
@ -92,6 +112,7 @@ function(bambustudio_add_cmake_project projectname)
-DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
-DBUILD_SHARED_LIBS:BOOL=OFF
${_cmake_osx_arch}
"${_configs_line}"
${DEP_CMAKE_OPTS}
${P_ARGS_CMAKE_ARGS}
@ -99,6 +120,26 @@ function(bambustudio_add_cmake_project projectname)
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
)
else()
ExternalProject_Add(
dep_${projectname}
EXCLUDE_FROM_ALL ON
INSTALL_DIR ${DESTDIR}/usr/local
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname}
${_gen}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}/usr/local
-DBUILD_SHARED_LIBS:BOOL=OFF
${_cmake_osx_arch}
"${_configs_line}"
${DEP_CMAKE_OPTS}
${P_ARGS_CMAKE_ARGS}
${P_ARGS_UNPARSED_ARGUMENTS}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
)
endif()
endfunction(bambustudio_add_cmake_project)