summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/00-Common.cmake2
-rw-r--r--indra/cmake/CMakeLists.txt2
-rw-r--r--indra/cmake/LLAddBuildTest.cmake116
3 files changed, 87 insertions, 33 deletions
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 0edacac7a9..a3c9becf0a 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -156,6 +156,8 @@ if (LINUX)
if (VIEWER)
add_definitions(-DAPPID=secondlife)
add_definitions(-fvisibility=hidden)
+ # don't catch SIGCHLD in our base application class for the viewer - some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The viewer doesn't need to catch SIGCHLD anyway.
+ add_definitions(-DLL_IGNORE_SIGCHLD)
if (NOT STANDALONE)
# this stops us requiring a really recent glibc at runtime
add_definitions(-fno-stack-protector)
diff --git a/indra/cmake/CMakeLists.txt b/indra/cmake/CMakeLists.txt
index 9ddcc62f2c..658441dab1 100644
--- a/indra/cmake/CMakeLists.txt
+++ b/indra/cmake/CMakeLists.txt
@@ -37,6 +37,7 @@ set(cmake_SOURCE_FILES
GStreamer.cmake
GooglePerfTools.cmake
JPEG.cmake
+ LLAddBuildTest.cmake
LLAudio.cmake
LLCharacter.cmake
LLCommon.cmake
@@ -70,6 +71,7 @@ set(cmake_SOURCE_FILES
Python.cmake
Prebuilt.cmake
QuickTime.cmake
+ RunBuildTest.cmake
TemplateCheck.cmake
Tut.cmake
UI.cmake
diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake
index 5d30818642..918a90e982 100644
--- a/indra/cmake/LLAddBuildTest.cmake
+++ b/indra/cmake/LLAddBuildTest.cmake
@@ -11,24 +11,21 @@ MACRO(ADD_BUILD_TEST_NO_COMMON name parent)
${APR_LIBRARIES}
${PTHREAD_LIBRARY}
${WINDOWS_LIBRARIES}
- )
- SET(no_common_libraries
- ${APRUTIL_LIBRARIES}
- ${APR_LIBRARIES}
- ${PTHREAD_LIBRARY}
- ${WINDOWS_LIBRARIES}
)
SET(no_common_source_files
${name}.cpp
tests/${name}_test.cpp
${CMAKE_SOURCE_DIR}/test/test.cpp
)
- ADD_BUILD_TEST_INTERNAL(${name} ${parent} "${no_common_libraries}" "${no_common_source_files}")
+ ADD_BUILD_TEST_INTERNAL("${name}" "${parent}" "${no_common_libraries}" "${no_common_source_files}")
ENDIF (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/${name}_test.cpp")
ENDMACRO(ADD_BUILD_TEST_NO_COMMON name parent)
MACRO(ADD_BUILD_TEST name parent)
+ # optional extra parameter: list of additional source files
+ SET(more_source_files "${ARGN}")
+
# MESSAGE("${CMAKE_CURRENT_SOURCE_DIR}/tests/${name}_test.cpp")
IF (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/${name}_test.cpp")
@@ -44,39 +41,39 @@ MACRO(ADD_BUILD_TEST name parent)
tests/${name}_test.cpp
${CMAKE_SOURCE_DIR}/test/test.cpp
${CMAKE_SOURCE_DIR}/test/lltut.cpp
+ ${more_source_files}
)
- ADD_BUILD_TEST_INTERNAL(${name} ${parent} "${basic_libraries}" "${basic_source_files}")
+ ADD_BUILD_TEST_INTERNAL("${name}" "${parent}" "${basic_libraries}" "${basic_source_files}")
+
ENDIF (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/${name}_test.cpp")
ENDMACRO(ADD_BUILD_TEST name parent)
+MACRO(ADD_VIEWER_BUILD_TEST name parent)
+ # This is just like the generic ADD_BUILD_TEST, but we implicitly
+ # add the necessary precompiled header .cpp file (anyone else find that
+ # oxymoronic?) because the MSVC build errors will NOT point you there.
+ ADD_BUILD_TEST("${name}" "${parent}" llviewerprecompiledheaders.cpp)
+ENDMACRO(ADD_VIEWER_BUILD_TEST name parent)
+
+
MACRO(ADD_SIMULATOR_BUILD_TEST name parent)
- SET(sim_source_files
- llsimprecompiledheaders.cpp
- ${name}.cpp
- tests/${name}_test.cpp
- ../test/lltut.cpp
- ../test/test.cpp
- )
- SET(basic_libraries
- ${LLCOMMON_LIBRARIES}
- ${APRUTIL_LIBRARIES}
- ${APR_LIBRARIES}
- ${PTHREAD_LIBRARY}
- ${WINDOWS_LIBRARIES}
- )
- ADD_BUILD_TEST_INTERNAL(${name} ${parent} "${basic_libraries}" "${sim_source_files}")
+ ADD_BUILD_TEST("${name}" "${parent}" llsimprecompiledheaders.cpp)
if (WINDOWS)
SET_SOURCE_FILES_PROPERTIES(
"tests/${name}_test.cpp"
PROPERTIES
COMPILE_FLAGS "/Yullsimprecompiledheaders.h"
- )
+ )
endif (WINDOWS)
ENDMACRO(ADD_SIMULATOR_BUILD_TEST name parent)
MACRO(ADD_BUILD_TEST_INTERNAL name parent libraries source_files)
+ # Optional additional parameter: pathname of Python wrapper script
+ SET(wrapper "${ARGN}")
+ #MESSAGE(STATUS "ADD_BUILD_TEST_INTERNAL ${name} wrapper = ${wrapper}")
+
SET(TEST_SOURCE_FILES ${source_files})
SET(HEADER "${name}.h")
set_source_files_properties(${HEADER}
@@ -87,17 +84,70 @@ MACRO(ADD_BUILD_TEST_INTERNAL name parent libraries source_files)
TARGET_LINK_LIBRARIES(${name}_test
${libraries}
)
-
+
GET_TARGET_PROPERTY(TEST_EXE ${name}_test LOCATION)
SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${name}_test_ok.txt)
+
+ SET(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR})
+ IF (wrapper)
+ SET(TEST_CMD ${PYTHON_EXECUTABLE} ${wrapper} ${TEST_CMD})
+ ENDIF (wrapper)
+
+ #MESSAGE(STATUS "ADD_BUILD_TEST_INTERNAL ${name} test_cmd = ${TEST_CMD}")
+ SET(TEST_SCRIPT_CMD
+ ${CMAKE_COMMAND}
+ -DLD_LIBRARY_PATH=${ARCH_PREBUILT_DIRS}:/usr/lib
+ -DTEST_CMD:STRING="${TEST_CMD}"
+ -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake
+ )
+
+ #MESSAGE(STATUS "ADD_BUILD_TEST_INTERNAL ${name} test_script = ${TEST_SCRIPT_CMD}")
ADD_CUSTOM_COMMAND(
- OUTPUT ${TEST_OUTPUT}
- COMMAND ${TEST_EXE}
- ARGS --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR}
- DEPENDS ${name}_test
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- )
+ OUTPUT ${TEST_OUTPUT}
+ COMMAND ${TEST_SCRIPT_CMD}
+ DEPENDS ${name}_test
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+
ADD_CUSTOM_TARGET(${name}_test_ok ALL DEPENDS ${TEST_OUTPUT})
- ADD_DEPENDENCIES(${parent} ${name}_test_ok)
+ IF (${parent})
+ ADD_DEPENDENCIES(${parent} ${name}_test_ok)
+ ENDIF (${parent})
+
+ENDMACRO(ADD_BUILD_TEST_INTERNAL name parent libraries source_files)
+
+
+MACRO(ADD_COMM_BUILD_TEST name parent wrapper)
+## MESSAGE(STATUS "ADD_COMM_BUILD_TEST ${name} wrapper = ${wrapper}")
+ # optional extra parameter: list of additional source files
+ SET(more_source_files "${ARGN}")
+## MESSAGE(STATUS "ADD_COMM_BUILD_TEST ${name} more_source_files = ${more_source_files}")
+
+ SET(libraries
+ ${LLMESSAGE_LIBRARIES}
+ ${LLMATH_LIBRARIES}
+ ${LLVFS_LIBRARIES}
+ ${LLCOMMON_LIBRARIES}
+ ${APRUTIL_LIBRARIES}
+ ${APR_LIBRARIES}
+ ${PTHREAD_LIBRARY}
+ ${WINDOWS_LIBRARIES}
+ )
+ SET(source_files
+ ${name}.cpp
+ tests/${name}_test.cpp
+ ${CMAKE_SOURCE_DIR}/test/test.cpp
+ ${CMAKE_SOURCE_DIR}/test/lltut.cpp
+ ${more_source_files}
+ )
+
+ ADD_BUILD_TEST_INTERNAL("${name}" "${parent}" "${libraries}" "${source_files}" "${wrapper}")
+ENDMACRO(ADD_COMM_BUILD_TEST name parent wrapper)
-ENDMACRO(ADD_BUILD_TEST_INTERNAL name parent libraries)
+MACRO(ADD_VIEWER_COMM_BUILD_TEST name parent wrapper)
+ # This is just like the generic ADD_COMM_BUILD_TEST, but we implicitly
+ # add the necessary precompiled header .cpp file (anyone else find that
+ # oxymoronic?) because the MSVC build errors will NOT point you there.
+## MESSAGE(STATUS "ADD_VIEWER_COMM_BUILD_TEST ${name} wrapper = ${wrapper}")
+ ADD_COMM_BUILD_TEST("${name}" "${parent}" "${wrapper}" llviewerprecompiledheaders.cpp)
+ENDMACRO(ADD_VIEWER_COMM_BUILD_TEST name parent wrapper)