mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-11 22:09:02 +08:00
Fixes:
- support verbose build (only on Ninja currently) - fix png -> zlib dependency markup - pass build type compiler flags to package builds (to implement full asan)
This commit is contained in:
parent
a8ba4f7ca9
commit
f65cbd8888
@ -3,6 +3,7 @@ include(ProcessorCount)
|
||||
|
||||
set(DESTDIR "${CMAKE_CURRENT_BINARY_DIR}/destdir" CACHE PATH "Destination directory")
|
||||
set(DEP_DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Path for downloaded source packages.")
|
||||
option(DEP_BUILD_VERBOSE "Use verbose output for each dependency build" OFF)
|
||||
|
||||
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||
|
||||
@ -32,14 +33,20 @@ function(add_cmake_project projectname)
|
||||
|
||||
set(_build_j "-j${_pcount}")
|
||||
if (CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
set(_build_j "/m:${_pcount}")
|
||||
set(_build_j "-m:${_pcount}")
|
||||
endif ()
|
||||
|
||||
string(TOUPPER "${CMAKE_BUILD_TYPE}" _build_type_upper)
|
||||
set(_configs_line -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
|
||||
if (_is_multi)
|
||||
set(_configs_line "")
|
||||
endif ()
|
||||
|
||||
set(_verbose_switch "")
|
||||
if (CMAKE_GENERATOR MATCHES "Ninja")
|
||||
set(_verbose_switch "--verbose")
|
||||
endif ()
|
||||
|
||||
ExternalProject_Add(
|
||||
dep_${projectname}
|
||||
EXCLUDE_FROM_ALL ON # Not built by default, dep_${projectname} needs to be added to ALL target
|
||||
@ -52,13 +59,15 @@ function(add_cmake_project projectname)
|
||||
-DCMAKE_DEBUG_POSTFIX:STRING=d
|
||||
-DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
|
||||
-DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
|
||||
-DCMAKE_CXX_FLAGS_${_build_type_upper}:STRING=${CMAKE_CXX_FLAGS_${_build_type_upper}}
|
||||
-DCMAKE_C_FLAGS_${_build_type_upper}:STRING=${CMAKE_C_FLAGS_${_build_type_upper}}
|
||||
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
|
||||
-DBUILD_SHARED_LIBS:BOOL=OFF
|
||||
"${_configs_line}"
|
||||
${DEP_CMAKE_OPTS}
|
||||
${P_ARGS_CMAKE_ARGS}
|
||||
${P_ARGS_UNPARSED_ARGUMENTS}
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} -- ${_build_j}
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config ${CMAKE_BUILD_TYPE} -- ${_build_j} ${_verbose_switch}
|
||||
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config ${CMAKE_BUILD_TYPE}
|
||||
)
|
||||
|
||||
|
2
deps/+PNG/PNG.cmake
vendored
2
deps/+PNG/PNG.cmake
vendored
@ -25,4 +25,4 @@ add_cmake_project(PNG
|
||||
${_disable_neon_extension}
|
||||
)
|
||||
|
||||
set(DEP_PMG_DEPENDS ZLIB)
|
||||
set(DEP_PNG_DEPENDS ZLIB)
|
||||
|
Loading…
x
Reference in New Issue
Block a user