From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 3051FA54C2E; Thu, 21 Mar 2024 17:03:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 3051FA54C2E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1711029807; bh=3ba7BJPmxSdNcvgopyaneZiD9/UP9x6uEaV+J6ikQU4=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=ymWow4DnVyumVwt4ysCNR8ZRxMd78dKoEIBJVeHuN+RNfh/bRBcwPp4xLn/ZLII4h j+B/Mj7KGN355JtEqkzk0klLPegoR8RUlGFMjNcrdzE8CFv5uq2WwsJ6zCBlMlGKOU 9vOlUSkrzX8dnm1HMqFweWuNkUzZYuLBDt0qVs04= Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 87291A54C22 for ; Thu, 21 Mar 2024 17:02:34 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 87291A54C22 Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-513d212f818so1167378e87.2 for ; Thu, 21 Mar 2024 07:02:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711029754; x=1711634554; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZNmGTL0LNOQvx9hI3BvOtOOJBxlvVqrbINz+ZicTFXQ=; b=KR/SAzcNN/5vqhU29iFIeu4u8emq8vxGymKDwpLcUrW36cZXIzsbAOlCn5n7y0jL3N 57EnbYDI+KzgVV9A+LcZxScEg90m8+fjgDXcWN3AVvP4gOcoKOIE5Ql3jiQ3FYZgkDiK Z03wUgaUU94gPZavoQkl8dnWiX97I6dxBjE3zQyRi/iBSUxan4OOs3E4nTRtEIRxa4l5 R6NXP5ZJwRXW4tbHEeEliUFF1zKAuQt4APcBF/Y/Pm0oVUqB2ahQcr+shH5JxhBmww0k V9k4oBlDanwykWrcdF4FoT0YTlnne4G7m231fK6eFZ7A4tg5mkKyww+T3ZvMz4O6gDRi wWug== X-Gm-Message-State: AOJu0Yz0hfplGlDURcl8dOQBWsprxe5/m0hPgxH9b7zU4k+OYtexNqzr QQhctC274VGCBAJiBWvw1tRXdk/Q+apUWO10TRHdndgsy/Ga8wxkj9e33F/k X-Google-Smtp-Source: AGHT+IEk/qpZ6Gb8Ejdmwua3UPKosXUa3BE+YkGXqqWFRN4H68ePvdICjHSf+xViZ6UpKoQsjt/Ypw== X-Received: by 2002:a05:6512:54e:b0:513:c963:895e with SMTP id h14-20020a056512054e00b00513c963895emr3786577lfl.42.1711029753503; Thu, 21 Mar 2024 07:02:33 -0700 (PDT) Received: from pony.. ([5.181.62.126]) by smtp.gmail.com with ESMTPSA id m30-20020a19435e000000b0051327d2f5e5sm2633561lfj.119.2024.03.21.07.02.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 07:02:33 -0700 (PDT) To: tarantool-patches@dev.tarantool.org, Sergey Kaplun , Maxim Kokryashkin Date: Thu, 21 Mar 2024 17:02:00 +0300 Message-Id: <6179514206d7197de2097bed75aa46862cb4e651.1711029149.git.sergeyb@tarantool.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH luajit 2/3][v4] test: update CMake macro LibRealPath X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" From: Sergey Bronnikov The patch updates CMake macro LibRealPath: - Replace CMAKE_CXX_COMPILER with CMAKE_C_COMPILER, because LuaJIT doesn't require CXX compiler and thus it can be unavailable on a build system. - Add a check for a code returned by a command with compiler. - Add a check for a value returned by compiler, the value equal to passed one means that library was not found in a system. --- test/LuaJIT-tests/CMakeLists.txt | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/test/LuaJIT-tests/CMakeLists.txt b/test/LuaJIT-tests/CMakeLists.txt index a0fb5440..f744abfe 100644 --- a/test/LuaJIT-tests/CMakeLists.txt +++ b/test/LuaJIT-tests/CMakeLists.txt @@ -33,12 +33,27 @@ if(LUAJIT_USE_ASAN) # https://github.com/google/sanitizers/issues/934. macro(LibRealPath output lib) execute_process( - COMMAND ${CMAKE_CXX_COMPILER} -print-file-name=${lib} + # CMAKE_C_COMPILER is used because it has the same behaviour + # as CMAKE_CXX_COMPILER, but CMAKE_CXX_COMPILER is not required + # for building LuaJIT and can be missed in GH Actions. + COMMAND ${CMAKE_C_COMPILER} -print-file-name=${lib} OUTPUT_VARIABLE LIB_LINK OUTPUT_STRIP_TRAILING_WHITESPACE + RESULT_VARIABLE RES ) + # GCC and Clang returns a passed filename, + # when library was not found. + if (${LIB_LINK} STREQUAL ${lib}) + message(FATAL_ERROR "Library '${lib}' is not found") + endif() + if (NOT RES EQUAL 0) + message(FATAL_ERROR "Executing '${CMAKE_C_COMPILER} \ + -print-file-name=${lib}' has failed") + endif() + # Fortunately, we are not interested in macOS here, so we can - # use realpath. + # use realpath. Beware, builtin commands always returns + # an exit code equal to 0, we cannot check is it failed or not. execute_process( COMMAND realpath ${LIB_LINK} OUTPUT_VARIABLE ${output} -- 2.34.1