diff options
author | Keith Mok <ek9852@gmail.com> | 2020-12-21 14:28:47 -0800 |
---|---|---|
committer | Jim Flynn <jim.flynn@arm.com> | 2021-01-13 17:03:39 +0000 |
commit | c712cf6c73ca6b390916fe6d3115a40cdcefc1ce (patch) | |
tree | 7ead7d09a9534e060e25070a12bbac67fe2576c6 /CMakeLists.txt | |
parent | fc3efb318f7607e5ac815665e3f28ce3e465cfb5 (diff) | |
download | armnn-c712cf6c73ca6b390916fe6d3115a40cdcefc1ce.tar.gz |
Fix build breaks on file insensitive system
Current we use 'A'rmNNQuantizer name for executable
and 'a'rmNNQuantizer as library name.
Since cmake does not allow same name for executable and library.
The old way is to use a captial letter for the executable name.
But it will create a problem on system (like macosx) that the file
system is case insensitive by default. Since it will create/overwritten
file on the same folder during the cmake build which makes build failed
when BUILD_ARMNN_QUANTIZER is enabled.
Fixed this by using ArmNNQuantizerMain as the executable
name during build, then rename it back to ArmNNQuantizer using
set_target_property OUTPUT_NAME function.
Signed-off-by: Keith Mok <ek9852@gmail.com>
Change-Id: I3e0779770c851c0eb6804e300a24836be955d07a
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 763c010d56..2eb0263beb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -199,13 +199,18 @@ if(BUILD_ARMNN_QUANTIZER AND ARMNNREF) target_link_libraries(armnnQuantizer armnn) - add_executable_ex(ArmnnQuantizer + add_executable_ex(ArmnnQuantizerMain src/armnnQuantizer/ArmNNQuantizerMain.cpp) - target_include_directories(ArmnnQuantizer PRIVATE include/armnnDeserializer) - target_include_directories(ArmnnQuantizer PRIVATE src/armnn) + # cmake does not allow same executable and library name + # workaround that by rename that using set_target_properties + set_target_properties(ArmnnQuantizerMain + PROPERTIES OUTPUT_NAME ArmnnQuantizer) - target_link_libraries(ArmnnQuantizer + target_include_directories(ArmnnQuantizerMain PRIVATE include/armnnDeserializer) + target_include_directories(ArmnnQuantizerMain PRIVATE src/armnn) + + target_link_libraries(ArmnnQuantizerMain armnnQuantizer armnnSerializer armnn @@ -213,7 +218,7 @@ if(BUILD_ARMNN_QUANTIZER AND ARMNNREF) ${FLATBUFFERS_LIBRARY}) if(Threads_FOUND AND (NOT ("${CMAKE_SYSTEM_NAME}" STREQUAL Android))) - target_link_libraries(ArmnnQuantizer pthread) + target_link_libraries(ArmnnQuantizerMain pthread) endif() set_target_properties(armnnQuantizer PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION}) @@ -1188,4 +1193,4 @@ add_library(Armnn::armnnUtils ALIAS armnnUtils) ## Build Python bindings if (BUILD_PYTHON_WHL OR BUILD_PYTHON_SRC) add_subdirectory(python/pyarmnn) -endif()
\ No newline at end of file +endif() |