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/llcommon/CMakeLists.txt | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) (limited to 'indra/llcommon/CMakeLists.txt') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 68378222d9..901686c815 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -13,14 +13,6 @@ include(Copy3rdPartyLibs) include(ZLIBNG) include(URIPARSER) -include_directories( - ${EXPAT_INCLUDE_DIRS} - ${LLCOMMON_INCLUDE_DIRS} - ${JSONCPP_INCLUDE_DIR} - ${ZLIBNG_INCLUDE_DIRS} - ${URIPARSER_INCLUDE_DIRS} - ) - # add_executable(lltreeiterators lltreeiterators.cpp) # # target_link_libraries(lltreeiterators @@ -286,22 +278,19 @@ else(LLCOMMON_LINK_SHARED) endif(LLCOMMON_LINK_SHARED) target_link_libraries( - llcommon - ${APRUTIL_LIBRARIES} - ${APR_LIBRARIES} - ${EXPAT_LIBRARIES} - ${JSONCPP_LIBRARIES} - ${ZLIBNG_LIBRARIES} + llcommon + apr::apr + expat::expat + jsoncpp::jsoncpp + zlib-ng::zlib-ng ${WINDOWS_LIBRARIES} - ${BOOST_FIBER_LIBRARY} - ${BOOST_CONTEXT_LIBRARY} - ${BOOST_PROGRAM_OPTIONS_LIBRARY} - ${BOOST_REGEX_LIBRARY} - ${BOOST_SYSTEM_LIBRARY} + boost::boost ${GOOGLE_PERFTOOLS_LIBRARIES} - ${URIPARSER_LIBRARIES} + uriparser::uriparser ) +set_target_include_dirs( llcommon ${CMAKE_CURRENT_SOURCE_DIR}) + if (DARWIN) include(CMakeFindFrameworks) find_library(CARBON_LIBRARY Carbon) @@ -319,13 +308,9 @@ if (LL_TESTS) #set(TEST_DEBUG on) set(test_libs llcommon - ${LLCOMMON_LIBRARIES} - ${WINDOWS_LIBRARIES} + ${WINDOWS_LIBRARIES} ${GOOGLEMOCK_LIBRARIES} - ${BOOST_FIBER_LIBRARY} - ${BOOST_CONTEXT_LIBRARY} - ${BOOST_THREAD_LIBRARY} - ${BOOST_SYSTEM_LIBRARY}) + ) LL_ADD_INTEGRATION_TEST(bitpack "" "${test_libs}") LL_ADD_INTEGRATION_TEST(classic_callback "" "${test_libs}") LL_ADD_INTEGRATION_TEST(commonmisc "" "${test_libs}") -- cgit v1.2.3 From ef989bce374516192c59be32af674de19295a31a Mon Sep 17 00:00:00 2001 From: Nicky Date: Wed, 6 Apr 2022 22:38:08 +0200 Subject: On OSX llcommon also needs CMAKE_CURRENT_SOURCE_DIR as PRIVATE include dir. --- indra/llcommon/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra/llcommon/CMakeLists.txt') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 901686c815..0fd2581dd4 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -290,6 +290,7 @@ target_link_libraries( ) set_target_include_dirs( llcommon ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories( llcommon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) if (DARWIN) include(CMakeFindFrameworks) @@ -307,10 +308,10 @@ if (LL_TESTS) LL_ADD_PROJECT_UNIT_TESTS(llcommon "${llcommon_TEST_SOURCE_FILES}") #set(TEST_DEBUG on) - set(test_libs llcommon - ${WINDOWS_LIBRARIES} - ${GOOGLEMOCK_LIBRARIES} - ) + set(test_libs llcommon + ${WINDOWS_LIBRARIES} + googlemock::googlemock + ) LL_ADD_INTEGRATION_TEST(bitpack "" "${test_libs}") LL_ADD_INTEGRATION_TEST(classic_callback "" "${test_libs}") LL_ADD_INTEGRATION_TEST(commonmisc "" "${test_libs}") -- 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/llcommon/CMakeLists.txt | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'indra/llcommon/CMakeLists.txt') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 0fd2581dd4..c934d47cc9 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -13,11 +13,6 @@ include(Copy3rdPartyLibs) include(ZLIBNG) include(URIPARSER) -# add_executable(lltreeiterators lltreeiterators.cpp) -# -# target_link_libraries(lltreeiterators -# ${LLCOMMON_LIBRARIES}) - set(llcommon_SOURCE_FILES indra_constants.cpp llallocator.cpp @@ -279,14 +274,14 @@ endif(LLCOMMON_LINK_SHARED) target_link_libraries( llcommon - apr::apr - expat::expat - jsoncpp::jsoncpp - zlib-ng::zlib-ng + ll::apr + ll::expat + ll::jsoncpp + ll::zlib-ng ${WINDOWS_LIBRARIES} - boost::boost + ll::boost ${GOOGLE_PERFTOOLS_LIBRARIES} - uriparser::uriparser + ll::uriparser ) set_target_include_dirs( llcommon ${CMAKE_CURRENT_SOURCE_DIR}) @@ -310,7 +305,7 @@ if (LL_TESTS) #set(TEST_DEBUG on) set(test_libs llcommon ${WINDOWS_LIBRARIES} - googlemock::googlemock + ll::googlemock ) LL_ADD_INTEGRATION_TEST(bitpack "" "${test_libs}") LL_ADD_INTEGRATION_TEST(classic_callback "" "${test_libs}") -- 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/llcommon/CMakeLists.txt | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'indra/llcommon/CMakeLists.txt') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index c934d47cc9..4673630a8e 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -278,21 +278,15 @@ target_link_libraries( ll::expat ll::jsoncpp ll::zlib-ng - ${WINDOWS_LIBRARIES} ll::boost ${GOOGLE_PERFTOOLS_LIBRARIES} ll::uriparser + ll::oslibraries ) set_target_include_dirs( llcommon ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories( llcommon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) -if (DARWIN) - include(CMakeFindFrameworks) - find_library(CARBON_LIBRARY Carbon) - target_link_libraries(llcommon ${CARBON_LIBRARY}) -endif (DARWIN) - add_dependencies(llcommon stage_third_party_libs) if (LL_TESTS) @@ -303,10 +297,7 @@ if (LL_TESTS) LL_ADD_PROJECT_UNIT_TESTS(llcommon "${llcommon_TEST_SOURCE_FILES}") #set(TEST_DEBUG on) - set(test_libs llcommon - ${WINDOWS_LIBRARIES} - ll::googlemock - ) + set(test_libs llcommon) LL_ADD_INTEGRATION_TEST(bitpack "" "${test_libs}") LL_ADD_INTEGRATION_TEST(classic_callback "" "${test_libs}") LL_ADD_INTEGRATION_TEST(commonmisc "" "${test_libs}") -- cgit v1.2.3 From 5803625db552900fd54c248c1f41e2f04bf66d62 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 17:18:38 +0200 Subject: Remove undefined variable GOOGLE_PERFTOOLS_LIBRARIES --- indra/llcommon/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llcommon/CMakeLists.txt') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 4673630a8e..11849c3766 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -279,7 +279,6 @@ target_link_libraries( ll::jsoncpp ll::zlib-ng ll::boost - ${GOOGLE_PERFTOOLS_LIBRARIES} ll::uriparser ll::oslibraries ) -- cgit v1.2.3 From 3ac18ad9932b4e2fda8e850bd18a524fb1593520 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 16 Apr 2022 22:08:40 +0200 Subject: Streamline bugsplat target: - Fix usage of bugsplat::bugsplat by using ll::bugsplat - Use bugsplat define by importing target not by using hand crafted magic --- indra/llcommon/CMakeLists.txt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'indra/llcommon/CMakeLists.txt') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 11849c3766..d5c57bbeaf 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -247,11 +247,6 @@ set(llcommon_HEADER_FILES set_source_files_properties(${llcommon_HEADER_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) -if (USE_BUGSPLAT) - set_source_files_properties(${llcommon_SOURCE_FILES} - PROPERTIES COMPILE_DEFINITIONS "${BUGSPLAT_DEFINE}") -endif (USE_BUGSPLAT) - list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES}) if(LLCOMMON_LINK_SHARED) @@ -275,6 +270,7 @@ endif(LLCOMMON_LINK_SHARED) target_link_libraries( llcommon ll::apr + ll::bugsplat ll::expat ll::jsoncpp ll::zlib-ng -- 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/llcommon/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/CMakeLists.txt') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index d5c57bbeaf..61d6196f50 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -279,7 +279,7 @@ target_link_libraries( ll::oslibraries ) -set_target_include_dirs( llcommon ${CMAKE_CURRENT_SOURCE_DIR}) +target_include_directories( llcommon INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) target_include_directories( llcommon PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) add_dependencies(llcommon stage_third_party_libs) -- 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/llcommon/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/llcommon/CMakeLists.txt') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 61d6196f50..f3e4f7f7f9 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -244,9 +244,6 @@ set(llcommon_HEADER_FILES StackWalker.h ) -set_source_files_properties(${llcommon_HEADER_FILES} - PROPERTIES HEADER_FILE_ONLY TRUE) - list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES}) if(LLCOMMON_LINK_SHARED) -- 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/llcommon/CMakeLists.txt | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'indra/llcommon/CMakeLists.txt') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index f3e4f7f7f9..832ff105f6 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -246,23 +246,7 @@ set(llcommon_HEADER_FILES list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES}) -if(LLCOMMON_LINK_SHARED) - add_library (llcommon SHARED ${llcommon_SOURCE_FILES}) - if(NOT ADDRESS_SIZE EQUAL 32) - if(WINDOWS) - ##add_definitions(/FIXED:NO) - else(WINDOWS) # not windows therefore gcc LINUX and DARWIN - add_definitions(-fPIC) - endif(WINDOWS) - endif(NOT ADDRESS_SIZE EQUAL 32) - if(WINDOWS) - # always generate llcommon.pdb, even for "Release" builds - set_target_properties(llcommon PROPERTIES LINK_FLAGS "/DEBUG") - endif(WINDOWS) - ll_stage_sharedlib(llcommon) -else(LLCOMMON_LINK_SHARED) - add_library (llcommon ${llcommon_SOURCE_FILES}) -endif(LLCOMMON_LINK_SHARED) +add_library (llcommon ${llcommon_SOURCE_FILES}) target_link_libraries( llcommon -- cgit v1.2.3 From c7366f4c55c6442414eb6c5a6736baf90f1a4700 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 17 Sep 2022 02:09:04 +0300 Subject: SL-17238 Fix coding policy build issues --- indra/llcommon/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/llcommon/CMakeLists.txt') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 8625060720..b576cdc1e1 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -268,8 +268,7 @@ target_link_libraries( ll::boost ll::uriparser ll::oslibraries - ll::tracy - + ll::tracy ) target_include_directories( llcommon INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -- cgit v1.2.3 From 069ccb30241716403c2de2d2d1faad62720917a3 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 23 Oct 2022 20:04:32 +0200 Subject: Remove ll::bugsplat as a llcommon depencency In theory it is fine to do that, in practice it does break gatekeeper in subtle ways due to https://developer.apple.com/library/archive/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG207 Having bugsplat linked to all executables results in executables with an embedded rpath that is invalid for Gatekeeper. Luckily it shows this is in the worst possible way. The viewer cannot be started with a non helpful message of teh viewer being unable to verified. While at the same time spctl and codesign both show no errors at all. --- indra/llcommon/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llcommon/CMakeLists.txt') diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index b576cdc1e1..56939584bb 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -261,7 +261,6 @@ add_library (llcommon ${llcommon_SOURCE_FILES}) target_link_libraries( llcommon ll::apr - ll::bugsplat ll::expat ll::jsoncpp ll::zlib-ng -- cgit v1.2.3