mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
shared libs are really always default now, static are opt-in only
This commit is contained in:
@ -6,6 +6,7 @@ set(Darknet_PATCH_VERSION 0)
|
||||
set(Darknet_VERSION ${Darknet_MAJOR_VERSION}.${Darknet_MINOR_VERSION}.${Darknet_PATCH_VERSION})
|
||||
|
||||
set(CMAKE_VERBOSE_MAKEFILE "FALSE" CACHE BOOL "Create verbose makefile")
|
||||
set(BUILD_SHARED_LIBS "TRUE" CACHE BOOL "Create darklib as a shared library")
|
||||
|
||||
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
|
||||
set(CMAKE_TOOLCHAIN_FILE "${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "")
|
||||
|
@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
$number_of_build_workers=8
|
||||
$create_shared_lib="-DBUILD_SHARED_LIBS:BOOL=ON"
|
||||
$force_using_include_libs=$false
|
||||
|
||||
#$my_cuda_compute_model=75 #Compute capability for Tesla T4, RTX 2080
|
||||
@ -88,7 +87,7 @@ if ($vcpkg_path) {
|
||||
# DEBUG
|
||||
New-Item -Path .\build_win_debug -ItemType directory -Force
|
||||
Set-Location build_win_debug
|
||||
cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" "-DCMAKE_TOOLCHAIN_FILE=$vcpkg_path\scripts\buildsystems\vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=$vcpkg_triplet" "-DCMAKE_BUILD_TYPE=Debug" $create_shared_lib $additional_build_setup ..
|
||||
cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" "-DCMAKE_TOOLCHAIN_FILE=$vcpkg_path\scripts\buildsystems\vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=$vcpkg_triplet" "-DCMAKE_BUILD_TYPE=Debug" $additional_build_setup ..
|
||||
cmake --build . --config Debug --target install
|
||||
#cmake --build . --config Debug --parallel ${number_of_build_workers} --target install #valid only for CMake 3.12+
|
||||
Remove-Item DarknetConfig.cmake
|
||||
@ -99,7 +98,7 @@ if ($vcpkg_path) {
|
||||
# RELEASE
|
||||
New-Item -Path .\build_win_release -ItemType directory -Force
|
||||
Set-Location build_win_release
|
||||
cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" "-DCMAKE_TOOLCHAIN_FILE=$vcpkg_path\scripts\buildsystems\vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=$vcpkg_triplet" "-DCMAKE_BUILD_TYPE=Release" $create_shared_lib $additional_build_setup ..
|
||||
cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" "-DCMAKE_TOOLCHAIN_FILE=$vcpkg_path\scripts\buildsystems\vcpkg.cmake" "-DVCPKG_TARGET_TRIPLET=$vcpkg_triplet" "-DCMAKE_BUILD_TYPE=Release" $additional_build_setup ..
|
||||
cmake --build . --config Release --target install
|
||||
#cmake --build . --config Release --parallel ${number_of_build_workers} --target install #valid only for CMake 3.12+
|
||||
Remove-Item DarknetConfig.cmake
|
||||
@ -113,7 +112,7 @@ else {
|
||||
# if you want to manually force this case, remove VCPKG_ROOT env variable and remember to use "vcpkg integrate remove" in case you had enabled user-wide vcpkg integration
|
||||
New-Item -Path .\build_win_release_novcpkg -ItemType directory -Force
|
||||
Set-Location build_win_release_novcpkg
|
||||
cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" $create_shared_lib $additional_build_setup ..
|
||||
cmake -G "Visual Studio 15 2017" -T "host=x64" -A "x64" $additional_build_setup ..
|
||||
cmake --build . --config Release --target install
|
||||
#cmake --build . --config Release --parallel ${number_of_build_workers} --target install #valid only for CMake 3.12+
|
||||
Remove-Item DarknetConfig.cmake
|
||||
|
10
build.sh
10
build.sh
@ -1,8 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
number_of_build_workers=8
|
||||
create_shared_lib="-DBUILD_SHARED_LIBS:BOOL=ON"
|
||||
|
||||
## by default darknet is built with CC 3.0 if cuda is found. Uncomment another CC (only one!) if you prefer a different choice
|
||||
#my_cuda_compute_model=75 #Compute capability for Tesla T4, RTX 2080
|
||||
#my_cuda_compute_model=72 #Compute capability for Jetson Xavier
|
||||
#my_cuda_compute_model=70 #Compute capability for Tesla V100
|
||||
@ -15,6 +13,8 @@ create_shared_lib="-DBUILD_SHARED_LIBS:BOOL=ON"
|
||||
#my_cuda_compute_model=35 #Compute capability for Tesla K20/K40
|
||||
#my_cuda_compute_model=30 #Compute capability for Tesla K10, Quadro K4000
|
||||
|
||||
number_of_build_workers=8
|
||||
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
OpenCV_DIR="/usr/local/Cellar/opencv@3/3.4.5"
|
||||
additional_defines="-DOpenCV_DIR=${OpenCV_DIR}"
|
||||
@ -31,7 +31,7 @@ fi
|
||||
# RELEASE
|
||||
mkdir -p build_release
|
||||
cd build_release
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release ${additional_defines} ${create_shared_lib} ${additional_build_setup}
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release ${additional_defines} ${additional_build_setup}
|
||||
cmake --build . --target install -- -j${number_of_build_workers}
|
||||
#cmake --build . --target install --parallel ${number_of_build_workers} #valid only for CMake 3.12+
|
||||
rm -f DarknetConfig.cmake
|
||||
@ -42,7 +42,7 @@ cp cmake/Modules/*.cmake share/darknet
|
||||
# DEBUG
|
||||
mkdir -p build_debug
|
||||
cd build_debug
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Debug ${additional_defines} ${create_shared_lib} ${additional_build_setup}
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Debug ${additional_defines} ${additional_build_setup}
|
||||
cmake --build . --target install -- -j${number_of_build_workers}
|
||||
#cmake --build . --target install --parallel ${number_of_build_workers} #valid only for CMake 3.12+
|
||||
rm -f DarknetConfig.cmake
|
||||
|
Reference in New Issue
Block a user