mirror of
https://github.com/rui314/mold.git
synced 2024-11-09 16:05:58 +03:00
Automatically detect if mold is sold
This commit is contained in:
parent
30aecda799
commit
bd584ac05e
@ -45,7 +45,6 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(mold VERSION 1.7.1)
|
||||
set(MOLD_PRODUCT_NAME "mold")
|
||||
|
||||
include(CMakeDependentOption)
|
||||
include(GNUInstallDirs)
|
||||
@ -192,6 +191,11 @@ else()
|
||||
mold_add_tbb()
|
||||
endif()
|
||||
|
||||
# Check if this is a commercial version of mold (a.k.a. "sold")
|
||||
if(EXISTS "${CMAKE_SOURCE_DIR}/LICENSE.md")
|
||||
set(MOLD_IS_SOLD ON)
|
||||
endif()
|
||||
|
||||
# We always use Clang to build mold on Windows. MSVC can't compile mold.
|
||||
if(WIN32)
|
||||
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
|
@ -1,3 +1,3 @@
|
||||
#define MOLD_VERSION "@mold_VERSION@"
|
||||
#define MOLD_LIBDIR "@CMAKE_INSTALL_FULL_LIBDIR@"
|
||||
#define MOLD_PRODUCT_NAME "@MOLD_PRODUCT_NAME@"
|
||||
#cmakedefine01 MOLD_IS_SOLD
|
||||
|
10
main.cc
10
main.cc
@ -28,14 +28,10 @@ int main(int argc, char **argv);
|
||||
}
|
||||
|
||||
static std::string get_mold_version() {
|
||||
std::string name = "mold ";
|
||||
if (MOLD_PRODUCT_NAME != "mold"s)
|
||||
name += "(" MOLD_PRODUCT_NAME ") ";
|
||||
name += MOLD_VERSION;
|
||||
|
||||
std::string name = MOLD_IS_SOLD ? "mold (sold) " : "mold ";
|
||||
if (mold_git_hash.empty())
|
||||
return name + " (compatible with GNU ld)";
|
||||
return name + " (" + mold_git_hash + "; compatible with GNU ld)";
|
||||
return name + MOLD_VERSION + " (compatible with GNU ld)";
|
||||
return name + MOLD_VERSION + " (" + mold_git_hash + "; compatible with GNU ld)";
|
||||
}
|
||||
|
||||
void cleanup() {
|
||||
|
Loading…
Reference in New Issue
Block a user