From 18d2a68c62da6e21ae31401be6d7753576df027e Mon Sep 17 00:00:00 2001 From: Jason Sandlin Date: Tue, 10 Oct 2023 13:39:44 -0700 Subject: [PATCH] Various minor fixes to LHC Linux CMake (#781) * Various minor fixes to LHC Linux CMake * PR feedback * PR feedback * Fixing Android cmake paths' --- .gitattributes | 58 +---------- .gitignore | 1 + .../libHttpClient.Android}/CMakeLists.txt | 8 +- .../libHttpClient.Android}/README.md | 3 +- Build/libHttpClient.Android/build.gradle | 2 +- .../GetCommonHCSourceFiles.cmake | 0 .../libHttpClient.CMake}/GetLibHCFlags.cmake | 0 .../GetOpenSSLFlags.cmake | 0 .../libHttpClient.CMake}/TargetSetFlags.cmake | 0 .../libHttpClient.Linux}/CMakeLists.txt | 15 +-- .../libHttpClient.Linux}/README.md | 0 .../libHttpClient.Linux/curl_Linux.bash | 7 -- .../libHttpClient_Linux.bash | 31 ++++-- .../libHttpClient.Linux/openssl_Linux.bash | 8 -- .../libcrypto.Android}/CMakeLists.txt | 6 +- Build/libcrypto.Android/README.md | 9 ++ Build/libcrypto.Android/build.gradle | 2 +- .../libssl.Android}/CMakeLists.txt | 6 +- Build/libssl.Android/README.md | 9 ++ Build/libssl.Android/build.gradle | 2 +- Utilities/CMake/.gitignore | 5 - .../Android/libHttpClient/GetLibHCFlags.cmake | 37 ------- Utilities/CMake/CMakeLists.txt | 99 ------------------- Utilities/CMake/Linux/README.md | 3 - Utilities/CMake/Linux/TargetSetFlags.cmake | 15 --- Utilities/Pipelines/Tasks/linux-build.yml | 6 +- 26 files changed, 71 insertions(+), 261 deletions(-) rename {Utilities/CMake/Android/libHttpClient => Build/libHttpClient.Android}/CMakeLists.txt (92%) rename {Utilities/CMake/Android => Build/libHttpClient.Android}/README.md (86%) rename {Utilities/CMake => Build/libHttpClient.CMake}/GetCommonHCSourceFiles.cmake (100%) rename {Utilities/CMake/Linux/libHttpClient => Build/libHttpClient.CMake}/GetLibHCFlags.cmake (100%) rename {Utilities/CMake/Android/openssl => Build/libHttpClient.CMake}/GetOpenSSLFlags.cmake (100%) rename {Utilities/CMake/Android => Build/libHttpClient.CMake}/TargetSetFlags.cmake (100%) rename {Utilities/CMake/Linux/libHttpClient => Build/libHttpClient.Linux}/CMakeLists.txt (87%) rename {Utilities/LinuxBuildScripts => Build/libHttpClient.Linux}/README.md (100%) rename Utilities/LinuxBuildScripts/curl.bash => Build/libHttpClient.Linux/curl_Linux.bash (87%) rename {Utilities/LinuxBuildScripts => Build/libHttpClient.Linux}/libHttpClient_Linux.bash (51%) rename Utilities/LinuxBuildScripts/openssl.bash => Build/libHttpClient.Linux/openssl_Linux.bash (88%) rename {Utilities/CMake/Android/openssl/libcrypto => Build/libcrypto.Android}/CMakeLists.txt (99%) create mode 100644 Build/libcrypto.Android/README.md rename {Utilities/CMake/Android/openssl/libssl => Build/libssl.Android}/CMakeLists.txt (94%) create mode 100644 Build/libssl.Android/README.md delete mode 100644 Utilities/CMake/.gitignore delete mode 100644 Utilities/CMake/Android/libHttpClient/GetLibHCFlags.cmake delete mode 100644 Utilities/CMake/CMakeLists.txt delete mode 100644 Utilities/CMake/Linux/README.md delete mode 100644 Utilities/CMake/Linux/TargetSetFlags.cmake diff --git a/.gitattributes b/.gitattributes index 1ff0c423..907c2d2f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,60 +4,6 @@ * text=auto ############################################################################### -# Set default behavior for command prompt diff. -# -# This is need for earlier builds of msysgit that does not have it on by -# default for csharp files. -# Note: This is only used by command line +# Don't add crlf to Linux bash files or they get Bash: /bin/bash^M: bad interpreter errors ############################################################################### -#*.cs diff=csharp - -############################################################################### -# Set the merge driver for project and solution files -# -# Merging from the command prompt will add diff markers to the files if there -# are conflicts (Merging from VS is not affected by the settings below, in VS -# the diff markers are never inserted). Diff markers may cause the following -# file extensions to fail to load in VS. An alternative would be to treat -# these files as binary and thus will always conflict and require user -# intervention with every merge. To do so, just uncomment the entries below -############################################################################### -#*.sln merge=binary -#*.csproj merge=binary -#*.vbproj merge=binary -#*.vcxproj merge=binary -#*.vcproj merge=binary -#*.dbproj merge=binary -#*.fsproj merge=binary -#*.lsproj merge=binary -#*.wixproj merge=binary -#*.modelproj merge=binary -#*.sqlproj merge=binary -#*.wwaproj merge=binary - -############################################################################### -# behavior for image files -# -# image files are treated as binary by default. -############################################################################### -#*.jpg binary -#*.png binary -#*.gif binary - -############################################################################### -# diff behavior for common document formats -# -# Convert binary document formats to text before diffing them. This feature -# is only available from the command line. Turn it on by uncommenting the -# entries below. -############################################################################### -#*.doc diff=astextplain -#*.DOC diff=astextplain -#*.docx diff=astextplain -#*.DOCX diff=astextplain -#*.dot diff=astextplain -#*.DOT diff=astextplain -#*.pdf diff=astextplain -#*.PDF diff=astextplain -#*.rtf diff=astextplain -#*.RTF diff=astextplain +*.bash text eol=lf diff --git a/.gitignore b/.gitignore index 63c73dea..e645911f 100644 --- a/.gitignore +++ b/.gitignore @@ -78,6 +78,7 @@ Output-Build.txt **/Durango/ **/XboxOne.x64/ +**/Int/ Samples/**/bin/ Samples/**/Debug/ Samples/**/Release/ diff --git a/Utilities/CMake/Android/libHttpClient/CMakeLists.txt b/Build/libHttpClient.Android/CMakeLists.txt similarity index 92% rename from Utilities/CMake/Android/libHttpClient/CMakeLists.txt rename to Build/libHttpClient.Android/CMakeLists.txt index 2f54f677..a5e80153 100644 --- a/Utilities/CMake/Android/libHttpClient/CMakeLists.txt +++ b/Build/libHttpClient.Android/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.6) -get_filename_component(PATH_TO_ROOT "../../../.." ABSOLUTE) +get_filename_component(PATH_TO_ROOT "../.." ABSOLUTE) project("libHttpClient.Android") @@ -10,7 +10,7 @@ set(CMAKE_STATIC_LIBRARY_PREFIX "") ### Set up paths for source and include ### ########################################### -include("../../GetCommonHCSourceFiles.cmake") +include("../libHttpClient.CMake/GetCommonHCSourceFiles.cmake") get_common_hc_source_files( PUBLIC_SOURCE_FILES HC_COMMON_SOURCE_FILES @@ -88,10 +88,10 @@ target_include_directories( "${ANDROID_INCLUDE_DIRS}" ) -include("GetLibHCFlags.cmake") +include("../libHttpClient.CMake/GetLibHCFlags.cmake") get_libhc_flags(FLAGS FLAGS_DEBUG FLAGS_RELEASE) -include("../TargetSetFlags.cmake") +include("../libHttpClient.CMake/TargetSetFlags.cmake") target_set_flags( "${PROJECT_NAME}" "${FLAGS}" diff --git a/Utilities/CMake/Android/README.md b/Build/libHttpClient.Android/README.md similarity index 86% rename from Utilities/CMake/Android/README.md rename to Build/libHttpClient.Android/README.md index c2d1e22f..e557bf60 100644 --- a/Utilities/CMake/Android/README.md +++ b/Build/libHttpClient.Android/README.md @@ -1,7 +1,6 @@ # libHttpClient Android CMake build system -This directory contains `CMakeLists.txt` files for building `libHttpClient`, -`libssl`, and `libcrypto` for Android via Gradle's +This directory contains `CMakeLists.txt` files for building `libHttpClient` for Android via Gradle's [external native build](https://developer.android.com/studio/projects/gradle-external-native-builds) integration with CMake. diff --git a/Build/libHttpClient.Android/build.gradle b/Build/libHttpClient.Android/build.gradle index 20f94aa6..efc08ef1 100644 --- a/Build/libHttpClient.Android/build.gradle +++ b/Build/libHttpClient.Android/build.gradle @@ -23,7 +23,7 @@ android { externalNativeBuild { cmake { - path "../../Utilities/CMake/Android/libHttpClient/CMakeLists.txt" + path "CMakeLists.txt" buildStagingDirectory "${project.buildDir.getParentFile().getAbsolutePath()}/.cxx/${project.name}" } } diff --git a/Utilities/CMake/GetCommonHCSourceFiles.cmake b/Build/libHttpClient.CMake/GetCommonHCSourceFiles.cmake similarity index 100% rename from Utilities/CMake/GetCommonHCSourceFiles.cmake rename to Build/libHttpClient.CMake/GetCommonHCSourceFiles.cmake diff --git a/Utilities/CMake/Linux/libHttpClient/GetLibHCFlags.cmake b/Build/libHttpClient.CMake/GetLibHCFlags.cmake similarity index 100% rename from Utilities/CMake/Linux/libHttpClient/GetLibHCFlags.cmake rename to Build/libHttpClient.CMake/GetLibHCFlags.cmake diff --git a/Utilities/CMake/Android/openssl/GetOpenSSLFlags.cmake b/Build/libHttpClient.CMake/GetOpenSSLFlags.cmake similarity index 100% rename from Utilities/CMake/Android/openssl/GetOpenSSLFlags.cmake rename to Build/libHttpClient.CMake/GetOpenSSLFlags.cmake diff --git a/Utilities/CMake/Android/TargetSetFlags.cmake b/Build/libHttpClient.CMake/TargetSetFlags.cmake similarity index 100% rename from Utilities/CMake/Android/TargetSetFlags.cmake rename to Build/libHttpClient.CMake/TargetSetFlags.cmake diff --git a/Utilities/CMake/Linux/libHttpClient/CMakeLists.txt b/Build/libHttpClient.Linux/CMakeLists.txt similarity index 87% rename from Utilities/CMake/Linux/libHttpClient/CMakeLists.txt rename to Build/libHttpClient.Linux/CMakeLists.txt index 55516b09..301aeb13 100644 --- a/Utilities/CMake/Linux/libHttpClient/CMakeLists.txt +++ b/Build/libHttpClient.Linux/CMakeLists.txt @@ -1,11 +1,14 @@ cmake_minimum_required(VERSION 3.6) -get_filename_component(PATH_TO_ROOT "../../../.." ABSOLUTE) +get_filename_component(PATH_TO_ROOT "../.." ABSOLUTE) project("libHttpClient.Linux.C") +set(CMAKE_C_COMPILER clang) +set(CMAKE_CXX_COMPILER clang++) +set(CMAKE_CXX_FLAGS "-fvisibility=hidden") +set(CMAKE_C_FLAGS "-fvisibility=hidden") set(CMAKE_STATIC_LIBRARY_PREFIX "") - set(CMAKE_POSITION_INDEPENDENT_CODE ON) ########################################### @@ -19,9 +22,9 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PATH_TO_ROOT}/Binaries/Release/x64/ # BINARY_DIR is a temp folder used by cmake itself. # Binary folder can be remove freely. # See more details: https://cmake.org/cmake/help/v3.4/command/add_subdirectory.html -set(BINARY_DIR ${PATH_TO_ROOT}/Build/libHttpClient.Linux.C/build) +set(BINARY_DIR ${PATH_TO_ROOT}/Int/CMake/libHttpClient.Linux.C) -include("../../GetCommonHCSourceFiles.cmake") +include("../libHttpClient.CMake/GetCommonHCSourceFiles.cmake") get_common_hc_source_files( PUBLIC_SOURCE_FILES HC_COMMON_SOURCE_FILES @@ -98,10 +101,10 @@ target_include_directories( "${LINUX_INCLUDE_DIRS}" ) -include("GetLibHCFlags.cmake") +include("../libHttpClient.CMake/GetLibHCFlags.cmake") get_libhc_flags(FLAGS FLAGS_DEBUG FLAGS_RELEASE) -include("../TargetSetFlags.cmake") +include("../libHttpClient.CMake/TargetSetFlags.cmake") target_set_flags( "${PROJECT_NAME}" "${FLAGS}" diff --git a/Utilities/LinuxBuildScripts/README.md b/Build/libHttpClient.Linux/README.md similarity index 100% rename from Utilities/LinuxBuildScripts/README.md rename to Build/libHttpClient.Linux/README.md diff --git a/Utilities/LinuxBuildScripts/curl.bash b/Build/libHttpClient.Linux/curl_Linux.bash similarity index 87% rename from Utilities/LinuxBuildScripts/curl.bash rename to Build/libHttpClient.Linux/curl_Linux.bash index 6532f755..5ad01fc9 100644 --- a/Utilities/LinuxBuildScripts/curl.bash +++ b/Build/libHttpClient.Linux/curl_Linux.bash @@ -21,13 +21,6 @@ while [[ $# -gt 0 ]]; do esac done -sudo hwclock --hctosys -sudo apt-get install clang -sudo apt-get install make -sudo apt-get install autoconf -sudo apt-get install automake -sudo apt-get install libtool - pushd "$SCRIPT_DIR"/../../External/curl autoreconf -fi "$SCRIPT_DIR"/../../External/curl diff --git a/Utilities/LinuxBuildScripts/libHttpClient_Linux.bash b/Build/libHttpClient.Linux/libHttpClient_Linux.bash similarity index 51% rename from Utilities/LinuxBuildScripts/libHttpClient_Linux.bash rename to Build/libHttpClient.Linux/libHttpClient_Linux.bash index 6f4bce79..aaa812be 100644 --- a/Utilities/LinuxBuildScripts/libHttpClient_Linux.bash +++ b/Build/libHttpClient.Linux/libHttpClient_Linux.bash @@ -27,6 +27,10 @@ while [[ $# -gt 0 ]]; do BUILD_SSL=false shift ;; + -sg|--skipaptget) + DO_APTGET=false + shift + ;; -*|--*) echo "Unknown option $1" exit 1 @@ -40,22 +44,35 @@ done set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters +if [ "$DO_APTGET" != "false" ]; then + sudo hwclock --hctosys + sudo apt-get update + sudo apt-get install clang + sudo apt-get install make + sudo apt-get install autoconf + sudo apt-get install automake + sudo apt-get install libtool +fi + log "CONFIGURATION = ${CONFIGURATION}" -log "BUILD CURL = ${SEARCHPATH}" +log "BUILD SSL = ${BUILD_SSL}" +log "BUILD CURL = ${BUILD_CURL}" +log "CMakeLists.txt = ${SCRIPT_DIR}" +log "CMake output = ${SCRIPT_DIR}/../../Int/CMake/libHttpClient.Linux.C" # make libcrypto and libssl if [ "$BUILD_SSL" = true ]; then log "Building SSL" - sed -i -e 's/\r$//' "$SCRIPT_DIR"/openssl.bash - bash "$SCRIPT_DIR"/openssl.bash -c "$CONFIGURATION" + sed -i -e 's/\r$//' "$SCRIPT_DIR"/openssl_Linux.bash + bash "$SCRIPT_DIR"/openssl_Linux.bash -c "$CONFIGURATION" fi if [ "$BUILD_CURL" = true ]; then log "Building cURL" - sed -i -e 's/\r$//' "$SCRIPT_DIR"/curl.bash - bash "$SCRIPT_DIR"/curl.bash -c "$CONFIGURATION" + sed -i -e 's/\r$//' "$SCRIPT_DIR"/curl_Linux.bash + bash "$SCRIPT_DIR"/curl_Linux.bash -c "$CONFIGURATION" fi # make libHttpClient -sudo cmake -S "$SCRIPT_DIR"/../CMake/Linux/libHttpClient -B "$SCRIPT_DIR"/../../Build/libHttpClient.Linux.C/build -D CMAKE_BUILD_TYPE=$CONFIGURATION -D CMAKE_C_COMPILER=clang -D CMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_FLAGS="-fvisibility=hidden" -DCMAKE_C_FLAGS="-fvisibility=hidden" -sudo make -C "$SCRIPT_DIR"/../../Build/libHttpClient.Linux.C/build +sudo cmake -S "$SCRIPT_DIR" -B "$SCRIPT_DIR"/../../Int/CMake/libHttpClient.Linux.C -D CMAKE_BUILD_TYPE=$CONFIGURATION +sudo make -C "$SCRIPT_DIR"/../../Int/CMake/libHttpClient.Linux.C diff --git a/Utilities/LinuxBuildScripts/openssl.bash b/Build/libHttpClient.Linux/openssl_Linux.bash similarity index 88% rename from Utilities/LinuxBuildScripts/openssl.bash rename to Build/libHttpClient.Linux/openssl_Linux.bash index 5a6a235f..55cbaffa 100644 --- a/Utilities/LinuxBuildScripts/openssl.bash +++ b/Build/libHttpClient.Linux/openssl_Linux.bash @@ -22,15 +22,7 @@ while [[ $# -gt 0 ]]; do esac done -sudo hwclock --hctosys -sudo apt-get install clang -sudo apt-get install make -sudo apt-get install autoconf -sudo apt-get install automake -sudo apt-get install libtool - pushd $OPENSSL_SRC -make clean sed -i -e 's/\r$//' Configure if [ "$CONFIGURATION" = "Debug" ]; then diff --git a/Utilities/CMake/Android/openssl/libcrypto/CMakeLists.txt b/Build/libcrypto.Android/CMakeLists.txt similarity index 99% rename from Utilities/CMake/Android/openssl/libcrypto/CMakeLists.txt rename to Build/libcrypto.Android/CMakeLists.txt index 13d5769c..10f2b209 100644 --- a/Utilities/CMake/Android/openssl/libcrypto/CMakeLists.txt +++ b/Build/libcrypto.Android/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.6) -get_filename_component(PATH_TO_ROOT "../../../../.." ABSOLUTE) +get_filename_component(PATH_TO_ROOT "../.." ABSOLUTE) project("libcrypto.Android") @@ -683,10 +683,10 @@ target_include_directories( "${CRYPTO_INCLUDE_DIRS}" ) -include("../GetOpenSSLFlags.cmake") +include("../libHttpClient.CMake/GetOpenSSLFlags.cmake") get_openssl_flags(FLAGS FLAGS_DEBUG FLAGS_RELEASE) -include("../../TargetSetFlags.cmake") +include("../libHttpClient.CMake/TargetSetFlags.cmake") target_set_flags( "${PROJECT_NAME}" "${FLAGS}" diff --git a/Build/libcrypto.Android/README.md b/Build/libcrypto.Android/README.md new file mode 100644 index 00000000..cce19a7c --- /dev/null +++ b/Build/libcrypto.Android/README.md @@ -0,0 +1,9 @@ +# libHttpClient Android CMake build system + +This directory contains `CMakeLists.txt` files for building `libcrypto` for Android via Gradle's +[external native build](https://developer.android.com/studio/projects/gradle-external-native-builds) +integration with CMake. + +The Gradle projects that reference these CMake builds are located in +`/Build/.Android`. See `/Build/libHttpClient.Android.Workspace` +for more details. diff --git a/Build/libcrypto.Android/build.gradle b/Build/libcrypto.Android/build.gradle index 6a3aff64..0c84d836 100644 --- a/Build/libcrypto.Android/build.gradle +++ b/Build/libcrypto.Android/build.gradle @@ -19,7 +19,7 @@ android { externalNativeBuild { cmake { - path "../../Utilities/Cmake/Android/openssl/libcrypto/CMakeLists.txt" + path "CMakeLists.txt" buildStagingDirectory "${project.buildDir.getParentFile().getAbsolutePath()}/.cxx/${project.name}" } } diff --git a/Utilities/CMake/Android/openssl/libssl/CMakeLists.txt b/Build/libssl.Android/CMakeLists.txt similarity index 94% rename from Utilities/CMake/Android/openssl/libssl/CMakeLists.txt rename to Build/libssl.Android/CMakeLists.txt index fbdf6099..0f75ddd9 100644 --- a/Utilities/CMake/Android/openssl/libssl/CMakeLists.txt +++ b/Build/libssl.Android/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.6) -get_filename_component(PATH_TO_ROOT "../../../../.." ABSOLUTE) +get_filename_component(PATH_TO_ROOT "../.." ABSOLUTE) project("libssl.Android") @@ -86,10 +86,10 @@ target_include_directories( "${SSL_INCLUDE_DIRS}" ) -include("../GetOpenSSLFlags.cmake") +include("../libHttpClient.CMake/GetOpenSSLFlags.cmake") get_openssl_flags(FLAGS FLAGS_DEBUG FLAGS_RELEASE) -include("../../TargetSetFlags.cmake") +include("../libHttpClient.CMake/TargetSetFlags.cmake") target_set_flags( "${PROJECT_NAME}" "${FLAGS}" diff --git a/Build/libssl.Android/README.md b/Build/libssl.Android/README.md new file mode 100644 index 00000000..7d62aac8 --- /dev/null +++ b/Build/libssl.Android/README.md @@ -0,0 +1,9 @@ +# libHttpClient Android CMake build system + +This directory contains `CMakeLists.txt` files for building `libssl` for Android via Gradle's +[external native build](https://developer.android.com/studio/projects/gradle-external-native-builds) +integration with CMake. + +The Gradle projects that reference these CMake builds are located in +`/Build/.Android`. See `/Build/libHttpClient.Android.Workspace` +for more details. diff --git a/Build/libssl.Android/build.gradle b/Build/libssl.Android/build.gradle index 0738a661..06ae3a68 100644 --- a/Build/libssl.Android/build.gradle +++ b/Build/libssl.Android/build.gradle @@ -19,7 +19,7 @@ android { externalNativeBuild { cmake { - path "../../Utilities/Cmake/Android/openssl/libssl/CMakeLists.txt" + path "CMakeLists.txt" buildStagingDirectory "${project.buildDir.getParentFile().getAbsolutePath()}/.cxx/${project.name}" } } diff --git a/Utilities/CMake/.gitignore b/Utilities/CMake/.gitignore deleted file mode 100644 index e7ffb318..00000000 --- a/Utilities/CMake/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -build -output -vcxprojs -ProjectFileProcessor/bin/Debug/ProjectFileProcessor.exe.config -!ProjectFileProcessor/bin/Debug diff --git a/Utilities/CMake/Android/libHttpClient/GetLibHCFlags.cmake b/Utilities/CMake/Android/libHttpClient/GetLibHCFlags.cmake deleted file mode 100644 index 3881cea5..00000000 --- a/Utilities/CMake/Android/libHttpClient/GetLibHCFlags.cmake +++ /dev/null @@ -1,37 +0,0 @@ -cmake_minimum_required(VERSION 3.6) - -# This function will set common, debug, and release config compiler flags -# into the three OUT_XXX variables, respectively. These are intended to then -# be passed to `target_set_flags`, from `TargetSetFlags.cmake`. -function(GET_LIBHC_FLAGS OUT_FLAGS OUT_FLAGS_DEBUG OUT_FLAGS_RELEASE) - set(FLAGS - "-Wall" - "-fexceptions" - "-frtti" - "-std=c++17" - "-Wno-unknown-pragmas" - "-Wno-pragma-once-outside-header" - "-DHC_PLATFORM_MSBUILD_GUESS=HC_PLATFORM_ANDROID" - PARENT_SCOPE - ) - - if (DEFINED HC_NOWEBSOCKETS) - list(APPEND FLAGS "-DHC_NOWEBSOCKETS=1") - endif() - - set("${OUT_FLAGS}" "${FLAGS}" PARENT_SCOPE) - - set("${OUT_FLAGS_DEBUG}" - "-O0" - "-std=c++17" - "-DHC_TRACE_BUILD_LEVEL=HC_PRIVATE_TRACE_LEVEL_VERBOSE" - PARENT_SCOPE - ) - - set("${OUT_FLAGS_RELEASE}" - "-Os" - "-std=c++17" - "-DHC_TRACE_BUILD_LEVEL=HC_PRIVATE_TRACE_LEVEL_IMPORTANT" - PARENT_SCOPE - ) -endfunction() diff --git a/Utilities/CMake/CMakeLists.txt b/Utilities/CMake/CMakeLists.txt deleted file mode 100644 index 13a201c0..00000000 --- a/Utilities/CMake/CMakeLists.txt +++ /dev/null @@ -1,99 +0,0 @@ -cmake_minimum_required (VERSION 3.6) - -project (${PROJECT_NAME}) - -if(MSVC_VERSION GREATER 1919) - set(COMPILER_VERSION "16") -elseif(MSVC_VERSION GREATER 1909) - set(COMPILER_VERSION "15") -elseif(MSVC_VERSION GREATER 1899) - set(COMPILER_VERSION "14") -elseif(MSVC_VERSION GREATER 1700) - set(COMPILER_VERSION "12") -elseif(MSVC_VERSION GREATER 1600) - set(COMPILER_VERSION "11") -endif() - -if(CMAKE_CONFIGURATION_TYPES) - set(CMAKE_CONFIGURATION_TYPES Debug) - set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Reset the configurations to what we need" FORCE) -endif() - -set(CMAKE_USE_RELATIVE_PATHS TRUE) - -if("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsStore") - set(PLATFORM STORE) -endif() - -set_property(GLOBAL PROPERTY USE_FOLDERS ON) - -add_compile_options(/Zm300 /bigobj) -if (WINDOWS_STORE OR WINDOWS_PHONE) - add_compile_options(/ZW) -endif() - -add_definitions(-D_NO_ASYNCRTIMP -D_NO_PPLXIMP -D_NO_XSAPIIMP -DXSAPI_BUILD) - -set_source_files_properties(../../../Source/Common/pch.cpp PROPERTIES COMPILE_OPTIONS "/Ycpch.h") - -if (NOT ${CMAKE_GENERATOR} MATCHES "Visual Studio .*") - set_property(SOURCE ../../../Source/Common/pch.cpp APPEND PROPERTY OBJECT_OUTPUTS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") - set_property(SOURCE ${SOURCES} APPEND PROPERTY OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/pch.pch") -endif() - -include_directories( - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/../../../Source - ${CMAKE_CURRENT_SOURCE_DIR}/../../../Source/Common - ${CMAKE_CURRENT_SOURCE_DIR}/../../../Source/HTTP - ${CMAKE_CURRENT_SOURCE_DIR}/../../../Source/Logger - ${CMAKE_CURRENT_SOURCE_DIR}/../../../Include - ${CMAKE_CURRENT_SOURCE_DIR}/../../../Include/httpClient - ) - -set(CMAKE_SUPPRESS_REGENERATION true) - -include(GetCommonHCSourceFiles.cmake) -get_common_hc_source_files( - Public_Source_Files - Common_Source_Files - Global_Source_Files - Platform_Source_Files - WebSocket_Source_Files - Task_Source_Files - Mock_Source_Files - HTTP_Source_Files - Logger_Source_Files - "../../.." - ) - -message(STATUS "Common source group") -source_group("Header Files" FILES ${Public_Source_Files}) -source_group("C++ Source\\Common" FILES ${Common_Source_Files}) -source_group("C++ Source\\Global" FILES ${Global_Source_Files}) -source_group("C++ Source\\Platform" FILES ${Platform_Source_Files}) -source_group("C++ Source\\WebSocket" FILES ${WebSocket_Source_Files}) -source_group("C++ Source\\Mock" FILES ${Mock_Source_Files}) -source_group("C++ Source\\HTTP" FILES ${HTTP_Source_Files}) -source_group("C++ Source\\Logger" FILES ${Logger_Source_Files}) - -set( SOURCE_FILES - ${Public_Source_Files} - ${Common_Source_Files} - ${Global_Source_Files} - ${Platform_Source_Files} - ${WebSocket_Source_Files} - ${Mock_Source_Files} - ${HTTP_Source_Files} - ${Logger_Source_Files} - ) - -list( SORT SOURCE_FILES ) -add_library(${PROJECT_NAME} ${SOURCE_FILES}) - -set_property(TARGET ${PROJECT_NAME} APPEND_STRING PROPERTY LINK_FLAGS "/INCREMENTAL:NO") -set(CMAKE_STATIC_LINKER_FLAGS "/INCREMENTAL:NO") - -message(STATUS "CMAKE_SYSTEM_VERSION='${CMAKE_SYSTEM_VERSION}'") -message(STATUS "CMAKE_SYSTEM_NAME='${CMAKE_SYSTEM_NAME}'") -message(STATUS "SHORT_VERSION='${SHORT_VERSION}'") diff --git a/Utilities/CMake/Linux/README.md b/Utilities/CMake/Linux/README.md deleted file mode 100644 index 4dfe19a5..00000000 --- a/Utilities/CMake/Linux/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# libHttpClient Linux CMake build system - -This directory contains `CMakeLists.txt` files for building `libHttpClient`. \ No newline at end of file diff --git a/Utilities/CMake/Linux/TargetSetFlags.cmake b/Utilities/CMake/Linux/TargetSetFlags.cmake deleted file mode 100644 index ceaac2fa..00000000 --- a/Utilities/CMake/Linux/TargetSetFlags.cmake +++ /dev/null @@ -1,15 +0,0 @@ -function(TARGET_SET_FLAGS TARGET_NAME FLAGS FLAGS_DEBUG FLAGS_RELEASE) - foreach(flag "${FLAGS}") - target_compile_options("${TARGET_NAME}" PRIVATE "${flag}") - endforeach() - - if (CMAKE_BUILD_TYPE STREQUAL "Debug") - foreach(flag "${FLAGS_DEBUG}") - target_compile_options("${TARGET_NAME}" PRIVATE "${flag}") - endforeach() - elseif (CMAKE_BUILD_TYPE STREQUAL "Release") - foreach(flag "${FLAGS_RELEASE}") - target_compile_options("${TARGET_NAME}" PRIVATE "${flag}") - endforeach() - endif() -endfunction() diff --git a/Utilities/Pipelines/Tasks/linux-build.yml b/Utilities/Pipelines/Tasks/linux-build.yml index 4e7b92cb..0fe3efad 100644 --- a/Utilities/Pipelines/Tasks/linux-build.yml +++ b/Utilities/Pipelines/Tasks/linux-build.yml @@ -8,17 +8,17 @@ steps: - task: Bash@3 displayName: 'Build and install OpenSSL' inputs: - filePath: './Utilities/LinuxBuildScripts/openssl.bash' + filePath: './Build/libHttpClient.Linux/openssl_Linux.bash' arguments: '-c ${{ parameters.configuration }}' - task: Bash@3 displayName: 'Build libcurl' inputs: - filePath: './Utilities/LinuxBuildScripts/curl.bash' + filePath: './Build/libHttpClient.Linux/curl_Linux.bash' arguments: '-c ${{ parameters.configuration }}' - task: Bash@3 displayName: 'Build libHttpClient' inputs: - filePath: './Utilities/LinuxBuildScripts/libHttpClient_Linux.bash' + filePath: './Build/libHttpClient.Linux/libHttpClient_Linux.bash' arguments: '-c ${{ parameters.configuration }} -nc -ns'