Skip to content

Commit

Permalink
Build: simplify USE_GPU macro
Browse files Browse the repository at this point in the history
  • Loading branch information
siyangy authored and xiaoxq committed Mar 5, 2019
1 parent 3857d48 commit 5e28acb
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions apollo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,11 @@ function config() {
${APOLLO_ROOT_DIR}/scripts/configurator.sh
}

function set_use_gpu() {
DEFINES="${DEFINES} --define USE_GPU=true"
USE_GPU="1"
}

function print_usage() {
RED='\033[0;31m'
BLUE='\033[0;34m'
Expand Down Expand Up @@ -708,8 +713,7 @@ function main() {
check $@
;;
build)
DEFINES="${DEFINES} --define USE_GPU=true --cxxopt=-DUSE_GPU"
USE_GPU="1"
set_use_gpu
apollo_build_dbg $@
;;
build_cpu)
Expand Down Expand Up @@ -760,13 +764,12 @@ function main() {
apollo_build_opt $@
;;
build_gpu)
DEFINES="${DEFINES} --define USE_GPU=true --cxxopt=-DUSE_GPU"
USE_GPU="1"
set_use_gpu
apollo_build_dbg $@
;;
build_opt_gpu)
DEFINES="${DEFINES} --define USE_GPU=true --cxxopt=-DUSE_GPU --copt=-fpic"
USE_GPU="1"
set_use_gpu
DEFINES="${DEFINES} --copt=-fpic"
apollo_build_opt $@
;;
build_fe)
Expand All @@ -788,8 +791,7 @@ function main() {
run_lint
;;
test)
DEFINES="${DEFINES} --define USE_GPU=true --cxxopt=-DUSE_GPU"
USE_GPU="1"
set_use_gpu
run_test $@
;;
test_cpu)
Expand All @@ -809,8 +811,7 @@ function main() {
citest_extended $@
;;
test_gpu)
DEFINES="${DEFINES} --cxxopt=-DUSE_GPU"
USE_GPU="1"
set_use_gpu
run_test $@
;;
release)
Expand Down

0 comments on commit 5e28acb

Please sign in to comment.