Skip to content

Commit 38b342a

Browse files
author
Timmy
committed
Merge pull request #82 from TimmyLiu/develop
do not build bingen if offline compilation is disabled
2 parents 8dc95f9 + d00b59a commit 38b342a

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/library/CMakeLists.txt

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,14 @@ ExternalProject_Add( tplgen
368368
INSTALL_COMMAND ""
369369
)
370370

371-
ExternalProject_Add( bingen
372-
URL "${CMAKE_SOURCE_DIR}/library/tools/bingen"
373-
CMAKE_ARGS -DOPENCL_LIBRARIES=${OPENCL_LIBRARIES} -DOPENCL_INCLUDE_DIRS=${OPENCL_INCLUDE_DIRS}
374-
INSTALL_COMMAND ""
375-
)
371+
# if offline compilation is not chosen, bingen should not be built
372+
if(OCL_OFFLINE_BUILD_TAHITI_KERNEL OR OCL_OFFLINE_BUILD_HAWAII_KERNEL OR OCL_OFFLINE_BUILD_BONAIRE_KERNEL)
373+
ExternalProject_Add( bingen
374+
URL "${CMAKE_SOURCE_DIR}/library/tools/bingen"
375+
CMAKE_ARGS -DOPENCL_LIBRARIES=${OPENCL_LIBRARIES} -DOPENCL_INCLUDE_DIRS=${OPENCL_INCLUDE_DIRS}
376+
INSTALL_COMMAND ""
377+
)
378+
endif()
376379

377380
message(STATUS "OCL_VERSION = ${OCL_VERSION}")
378381
if( OCL_VERSION STREQUAL "2.0")
@@ -407,7 +410,10 @@ else()
407410
endif()
408411

409412
#set( bingenBinaryDir "${CMAKE_BINARY_DIR}/library/tools/bingen/staging" )
410-
ExternalProject_Get_Property( bingen binary_dir )
413+
# if offline compilation is not chosen, bingen should not be built
414+
if(OCL_OFFLINE_BUILD_TAHITI_KERNEL OR OCL_OFFLINE_BUILD_HAWAII_KERNEL OR OCL_OFFLINE_BUILD_BONAIRE_KERNEL)
415+
ExternalProject_Get_Property( bingen binary_dir )
416+
411417
set( bingenBinaryDir "" )
412418
if( CMAKE_COMPILER_IS_GNUCXX )
413419
set( bingenBinaryDir "${binary_dir}/staging" )
@@ -438,6 +444,7 @@ add_custom_command(TARGET GEN_CLBIN
438444
)
439445
add_dependencies( GEN_CLBIN bingen )
440446
endif()
447+
endif()#if(OCL_OFFLINE_BUILD_TAHITI_KERNEL OR OCL_OFFLINE_BUILD_HAWAII_KERNEL OR OCL_OFFLINE_BUILD_BONAIRE_KERNEL)
441448

442449
ExternalProject_Get_Property( tplgen binary_dir )
443450

0 commit comments

Comments
 (0)