diff options
Diffstat (limited to 'volk/lib')
-rw-r--r-- | volk/lib/CMakeLists.txt | 46 | ||||
-rw-r--r-- | volk/lib/volk_prefs.c | 2 |
2 files changed, 40 insertions, 8 deletions
diff --git a/volk/lib/CMakeLists.txt b/volk/lib/CMakeLists.txt index 33a478265..645a0dc17 100644 --- a/volk/lib/CMakeLists.txt +++ b/volk/lib/CMakeLists.txt @@ -27,6 +27,14 @@ EXECUTE_PROCESS( OUTPUT_VARIABLE arch_lines OUTPUT_STRIP_TRAILING_WHITESPACE ) +#get any mutually exclusive archs so we can exclude them +#this is really for compilers which can do both 32- and 64-bit compilations. +EXECUTE_PROCESS( + COMMAND ${PYTHON_EXECUTABLE} -c + "from xml.dom import minidom; print ';'.join(map(lambda a: '%s %s'%(a.parentNode.attributes['name'].value,a.firstChild.data),minidom.parse('${CMAKE_SOURCE_DIR}/gen/archs.xml').getElementsByTagName('mutex')))" + OUTPUT_VARIABLE mutex_lines OUTPUT_STRIP_TRAILING_WHITESPACE +) + #This macro sets the ${arch}_flag variable, #and handles special cases for MSVC arch flags. MACRO(set_arch_flag name flag) @@ -59,12 +67,25 @@ MACRO(handle_arch name flag) ENDIF() ENDMACRO(handle_arch) +MACRO(remove_mutex name mutex) + IF(have_${name}) + UNSET(have_${mutex}) + ENDIF() + LIST(REMOVE_ITEM available_arches ${mutex}) +ENDMACRO(remove_mutex) + #create a list of available arches FOREACH(arch_line ${arch_lines}) SEPARATE_ARGUMENTS(args UNIX_COMMAND "${arch_line}") handle_arch(${args}) ENDFOREACH(arch_line) +#strip out mutex archs +FOREACH(mutex_line ${mutex_lines}) + SEPARATE_ARGUMENTS(args UNIX_COMMAND "${mutex_line}") + remove_mutex(${args}) +ENDFOREACH(mutex_line) + MESSAGE(STATUS "Available arches: ${available_arches}") ######################################################################## @@ -147,10 +168,20 @@ FILE(GLOB xml_files ${CMAKE_SOURCE_DIR}/gen/*.xml) FILE(GLOB py_files ${CMAKE_SOURCE_DIR}/gen/*.py) FILE(GLOB h_files ${CMAKE_SOURCE_DIR}/include/volk/*.h) +#make sure we can use -B with python (introduced in 2.6) +EXECUTE_PROCESS( + COMMAND ${PYTHON_EXECUTABLE} -B -c "" + OUTPUT_QUIET ERROR_QUIET + RESULT_VARIABLE PYTHON_HAS_DASH_B_RESULT +) +IF(PYTHON_HAS_DASH_B_RESULT EQUAL 0) + SET(PYTHON_DASH_B "-B") +ENDIF() + ADD_CUSTOM_COMMAND( OUTPUT ${volk_gen_sources} DEPENDS ${xml_files} ${py_files} ${h_files} - COMMAND ${PYTHON_EXECUTABLE} -B + COMMAND ${PYTHON_EXECUTABLE} ${PYTHON_DASH_B} ${CMAKE_SOURCE_DIR}/gen/volk_register.py ${CMAKE_BINARY_DIR} ) @@ -160,7 +191,7 @@ ADD_CUSTOM_COMMAND( ######################################################################## FIND_PACKAGE(PkgConfig) IF(PKG_CONFIG_FOUND) -PKG_CHECK_MODULES(ORC "orc-0.4") +PKG_CHECK_MODULES(ORC "orc-0.4 > 0.4.11") ENDIF(PKG_CONFIG_FOUND) FIND_PROGRAM(ORCC_EXECUTABLE orcc) @@ -194,7 +225,8 @@ ENDIF() ######################################################################## # Setup the volk sources list and library ######################################################################## -IF(NOT WIN32) +IF(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32) + #http://gcc.gnu.org/wiki/Visibility ADD_DEFINITIONS(-fvisibility=hidden) ENDIF() @@ -231,9 +263,9 @@ SET_TARGET_PROPERTIES(volk PROPERTIES SOVERSION ${LIBVER}) SET_TARGET_PROPERTIES(volk PROPERTIES DEFINE_SYMBOL "volk_EXPORTS") INSTALL(TARGETS volk - LIBRARY DESTINATION lib${LIB_SUFFIX} # .so file - ARCHIVE DESTINATION lib${LIB_SUFFIX} # .lib file - RUNTIME DESTINATION bin # .dll file + LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_runtime" # .so file + ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT "volk_devel" # .lib file + RUNTIME DESTINATION bin COMPONENT "volk_runtime" # .dll file ) ######################################################################## @@ -256,6 +288,6 @@ ADD_EXECUTABLE(test_all ${CMAKE_CURRENT_SOURCE_DIR}/qa_utils.cc ) TARGET_LINK_LIBRARIES(test_all volk ${Boost_LIBRARIES}) -ADD_TEST(qa_volk_test_all test_all) +#ADD_TEST(qa_volk_test_all test_all) ENDIF() diff --git a/volk/lib/volk_prefs.c b/volk/lib/volk_prefs.c index 9743c51d9..b29d5fd87 100644 --- a/volk/lib/volk_prefs.c +++ b/volk/lib/volk_prefs.c @@ -23,7 +23,7 @@ int load_preferences(struct volk_arch_pref **prefs) { //get the config path get_config_path(path); config_file = fopen(path, "r"); - if(!config_file) return; //no prefs found + if(!config_file) return n_arch_prefs; //no prefs found while(fgets(line, 512, config_file) != NULL) { if(sscanf(line, "%s %s", function, arch) == 2 && !strncmp(function, "volk_", 5)) { |