From 786b291d9c6b784c7ce6ceef0e38a4ec76ea14db Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 16:32:52 +0200 Subject: Move CMake files to modernized cmake syntax, step 1. Change projects to cmake targetsto get rid of havig to hardcore include directories and link libraries in consumer projects. --- indra/llcorehttp/CMakeLists.txt | 53 +++++++++++++---------------------------- 1 file changed, 16 insertions(+), 37 deletions(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index c591680250..271ddbcd2d 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -10,18 +10,11 @@ include(NGHTTP2) include(ZLIBNG) include(LLCoreHttp) include(LLAddBuildTest) -include(LLMessage) include(LLCommon) include(Tut) include(bugsplat) -include_directories (${CMAKE_CURRENT_SOURCE_DIR}) - -include_directories( - ${LLMESSAGE_INCLUDE_DIRS} - ${LLCOMMON_INCLUDE_DIRS} - ${LLCOREHTTP_INCLUDE_DIRS} - ) +include_directories (${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../llmessage ) set(llcorehttp_SOURCE_FILES bufferarray.cpp @@ -92,14 +85,14 @@ list(APPEND llcorehttp_SOURCE_FILES ${llcorehttp_HEADER_FILES}) add_library (llcorehttp ${llcorehttp_SOURCE_FILES}) target_link_libraries( - llcorehttp - ${CURL_LIBRARIES} - ${OPENSSL_LIBRARIES} - ${CRYPTO_LIBRARIES} - ${NGHTTP2_LIBRARIES} - ${BOOST_THREAD_LIBRARY} - ${BOOST_SYSTEM_LIBRARY} + llcorehttp + llcommon + libcurl::libcurl + openssl::openssl + nghttp2::nghttp2 ) +set_target_include_dirs( llcorehttp ${CMAKE_CURRENT_SOURCE_DIR}) + # tests set(LLCOREHTTP_TESTS ON CACHE BOOL @@ -128,17 +121,10 @@ if (LL_TESTS AND LLCOREHTTP_TESTS) # set(TEST_DEBUG on) set(test_libs - ${LLCOREHTTP_LIBRARIES} - ${WINDOWS_LIBRARIES} - ${LLMESSAGE_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ${GOOGLEMOCK_LIBRARIES} - ${CURL_LIBRARIES} - ${OPENSSL_LIBRARIES} - ${CRYPTO_LIBRARIES} - ${NGHTTP2_LIBRARIES} - ${BOOST_THREAD_LIBRARY} - ${BOOST_SYSTEM_LIBRARY} + llcorehttp + ${WINDOWS_LIBRARIES} + llmessage + llcommon ) # If http_proxy is in the current environment (e.g. to fetch s3-proxy @@ -201,17 +187,10 @@ endif (DARWIN) set(example_libs ${LEGACY_STDIO_LIBS} - ${LLCOREHTTP_LIBRARIES} - ${WINDOWS_LIBRARIES} - ${LLMESSAGE_LIBRARIES} - ${LLCOMMON_LIBRARIES} - ${GOOGLEMOCK_LIBRARIES} - ${CURL_LIBRARIES} - ${OPENSSL_LIBRARIES} - ${CRYPTO_LIBRARIES} - ${NGHTTP2_LIBRARIES} - ${BOOST_THREAD_LIBRARY} - ${BOOST_SYSTEM_LIBRARY} + llcorehttp + ${WINDOWS_LIBRARIES} + llmessage + llcommon ) add_executable(http_texture_load -- cgit v1.2.3 From 241919e7f7986c11586a49bff53cf19c2c0e0ea6 Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 13 Apr 2022 19:21:55 +0200 Subject: Rework cmake, the original plan was to maybe be able to use conan targets with the same name (that's why 3ps had names like apr::apr), but it's safer and saner to put the LL 3ps under the ll:: prefix. This also allows means it is possible to get rid of that bad "if( TRAGET ...) return() endif()" pattern and rather use include_guard(). --- indra/llcorehttp/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index 271ddbcd2d..041c90b174 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -87,9 +87,9 @@ add_library (llcorehttp ${llcorehttp_SOURCE_FILES}) target_link_libraries( llcorehttp llcommon - libcurl::libcurl - openssl::openssl - nghttp2::nghttp2 + ll::libcurl + ll::openssl + ll::nghttp2 ) set_target_include_dirs( llcorehttp ${CMAKE_CURRENT_SOURCE_DIR}) -- cgit v1.2.3 From bb85651d987a6cb969de7dd7c2b130411de6203c Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 15:29:02 +0200 Subject: Create a new target ll::oslibrary to link against libs specific to the OS compiled on. This gets rid of the a few OS specific set and uses variables (which some even seemed mostly duplicate like WINDOWS_LIBRARIES ans UI_LIBRARIES) and it also solves the problem of having them to tack on every target, as of no they come as a transitive dependency from llcommon --- indra/llcorehttp/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index 041c90b174..0d45814d86 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -122,7 +122,6 @@ if (LL_TESTS AND LLCOREHTTP_TESTS) # set(TEST_DEBUG on) set(test_libs llcorehttp - ${WINDOWS_LIBRARIES} llmessage llcommon ) @@ -188,7 +187,6 @@ endif (DARWIN) set(example_libs ${LEGACY_STDIO_LIBS} llcorehttp - ${WINDOWS_LIBRARIES} llmessage llcommon ) -- cgit v1.2.3 From b9f94c08977ff76f41a32a2bb9f25883e578eea3 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 15:33:32 +0200 Subject: Now there is a oslibrary target get rid of some more obsolete vars: LEGACY_STDIO_LIBS (was only used for Windows) PTHREAD_LIBRARY (only Linux) LLDATABASE_LIBRARIES (that one was supposed for Linux, but never needed anyway) --- indra/llcorehttp/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index 0d45814d86..e2bd9ae5b8 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -185,7 +185,6 @@ endif (DARWIN) ) set(example_libs - ${LEGACY_STDIO_LIBS} llcorehttp llmessage llcommon -- cgit v1.2.3 From e0cf0cdfd49e5a946dcd202a083fb23f01e4f1fe Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 17 Apr 2022 18:04:57 +0200 Subject: Switch to target_include_directories All 3Ps include dirs are treated as SYSTEM, this will stop compilers stop emitting warnings from those files and greatly helps having high warning levels and not being swamped by warnings that come from external libraries. --- indra/llcorehttp/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index e2bd9ae5b8..f93104b321 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -91,7 +91,7 @@ target_link_libraries( ll::openssl ll::nghttp2 ) -set_target_include_dirs( llcorehttp ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories( llcorehttp INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) # tests -- cgit v1.2.3 From 283c2a20cc4ef856076d287303c7143332b201fe Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 1 May 2022 00:38:40 +0200 Subject: Remove setting of HEADER_FILE_ONLY on .h* files, cmake automatically sets the property on those. --- indra/llcorehttp/CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index f93104b321..481e58993a 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -73,8 +73,6 @@ set(llcorehttp_HEADER_FILES _thread.h ) -set_source_files_properties(${llcorehttp_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) if (DARWIN OR LINUX) # Boost headers define unused members in condition_variable so... set_source_files_properties(${llcorehttp_SOURCE_FILES} @@ -112,9 +110,6 @@ if (LL_TESTS AND LLCOREHTTP_TESTS) tests/test_bufferstream.hpp ) - set_source_files_properties(${llcorehttp_TEST_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - list(APPEND llcorehttp_TEST_SOURCE_FILES ${llcorehttp_TEST_HEADER_FILES}) # LL_ADD_PROJECT_UNIT_TESTS(llcorehttp "${llcorehttp_TEST_SOURCE_FILES}") -- cgit v1.2.3 From 767464a2627036e8a16ac323c886e0a1712e0a5f Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 7 May 2022 02:19:51 +0200 Subject: Adapt gnerator expression usage to work on OSX. --- indra/llcorehttp/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index 481e58993a..08139910d3 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -135,7 +135,7 @@ if (LL_TESTS AND LLCOREHTTP_TESTS) if (DARWIN) # Path inside the app bundle where we'll need to copy libraries set(LL_TEST_DESTINATION_DIR - ${CMAKE_BINARY_DIR}/sharedlibs/Resources + ${CMAKE_BINARY_DIR}/sharedlibs/$,,../>Resources ) # Create the Contents/Resources directory -- cgit v1.2.3 From 8e0b039e554e320cedfdef3057a3073a493db2e7 Mon Sep 17 00:00:00 2001 From: Nicky Dasmijn Date: Sat, 17 Sep 2022 17:14:16 +0200 Subject: Cleanup sweep --- indra/llcorehttp/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/CMakeLists.txt b/indra/llcorehttp/CMakeLists.txt index 08139910d3..87796abd3c 100644 --- a/indra/llcorehttp/CMakeLists.txt +++ b/indra/llcorehttp/CMakeLists.txt @@ -14,8 +14,6 @@ include(LLCommon) include(Tut) include(bugsplat) -include_directories (${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../llmessage ) - set(llcorehttp_SOURCE_FILES bufferarray.cpp bufferstream.cpp @@ -89,8 +87,11 @@ target_link_libraries( ll::openssl ll::nghttp2 ) -target_include_directories( llcorehttp INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) - +target_include_directories( llcorehttp INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) +# llmessage depends on llcorehttp, yet llcorehttp also depends on llmessage (at least for includes). +# Cannot/Should not use target_link_libraries here to add llmessage to the dependencies, as that would +# lead to circular dependencies (or in case of cmake, the first project declaring it's dependencies wins) +target_include_directories( llcorehttp PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../llmessage) # tests set(LLCOREHTTP_TESTS ON CACHE BOOL -- cgit v1.2.3 From d6cf9e27724963753485d872906fbae061a280ab Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Fri, 24 Mar 2023 15:30:22 -0700 Subject: Attempt to fix build breakage for DRTVWR-559 --- indra/llcorehttp/tests/test_llcorehttp_peer.py | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llcorehttp') diff --git a/indra/llcorehttp/tests/test_llcorehttp_peer.py b/indra/llcorehttp/tests/test_llcorehttp_peer.py index 778de90962..185e8e25c6 100755 --- a/indra/llcorehttp/tests/test_llcorehttp_peer.py +++ b/indra/llcorehttp/tests/test_llcorehttp_peer.py @@ -38,7 +38,6 @@ from io import StringIO from http.server import HTTPServer, BaseHTTPRequestHandler -from llbase.fastest_elementtree import parse as xml_parse from llbase import llsd # we're in llcorehttp/tests ; testrunner.py is found in llmessage/tests -- cgit v1.2.3