diff --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt --- a/flang/CMakeLists.txt +++ b/flang/CMakeLists.txt @@ -268,10 +268,6 @@ set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}") -# Override LLVM versioning for now... -set(FLANG_VERSION_MAJOR "0") -set(FLANG_VERSION_MINOR "1") -set(FLANG_VERSION_PATCHLEVEL "0") if (NOT DEFINED FLANG_VERSION_MAJOR) diff --git a/flang/include/flang/Version.inc.in b/flang/include/flang/Version.inc.in --- a/flang/include/flang/Version.inc.in +++ b/flang/include/flang/Version.inc.in @@ -1,5 +1,8 @@ #define FLANG_VERSION @FLANG_VERSION@ #define FLANG_VERSION_STRING "@FLANG_VERSION@" #define FLANG_VERSION_MAJOR @FLANG_VERSION_MAJOR@ +#define FLANG_VERSION_MAJOR_STRING "@FLANG_VERSION_MAJOR@" #define FLANG_VERSION_MINOR @FLANG_VERSION_MINOR@ +#define FLANG_VERSION_MINOR_STRING "@FLANG_VERSION_MINOR@" #define FLANG_VERSION_PATCHLEVEL @FLANG_VERSION_PATCHLEVEL@ +#define FLANG_VERSION_PATCHLEVEL_STRING "@FLANG_VERSION_PATCHLEVEL@" diff --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt --- a/flang/tools/f18/CMakeLists.txt +++ b/flang/tools/f18/CMakeLists.txt @@ -72,5 +72,3 @@ FILE_PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE) install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/flang DESTINATION bin) endif() - -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/f18_version.h.in ${CMAKE_CURRENT_BINARY_DIR}/f18_version.h @ONLY) diff --git a/flang/tools/f18/f18.cpp b/flang/tools/f18/f18.cpp --- a/flang/tools/f18/f18.cpp +++ b/flang/tools/f18/f18.cpp @@ -8,7 +8,6 @@ // Temporary Fortran front end driver main program for development scaffolding. -#include "f18_version.h" #include "flang/Common/Fortran-features.h" #include "flang/Common/default-kinds.h" #include "flang/Evaluate/expression.h" @@ -25,6 +24,7 @@ #include "flang/Semantics/runtime-type-info.h" #include "flang/Semantics/semantics.h" #include "flang/Semantics/unparse-with-symbols.h" +#include "flang/Version.inc" #include "llvm/Support/Errno.h" #include "llvm/Support/FileSystem.h" #include "llvm/Support/Program.h" @@ -389,8 +389,8 @@ int printVersion() { llvm::errs() << "\nf18 compiler (under development), version " - << __FLANG_MAJOR__ << "." << __FLANG_MINOR__ << "." - << __FLANG_PATCHLEVEL__ << "\n"; + << FLANG_VERSION_MAJOR << "." << FLANG_VERSION_MINOR << "." + << FLANG_VERSION_PATCHLEVEL << "\n"; return exitStatus; } @@ -415,11 +415,13 @@ options.predefinitions.emplace_back("__F18_MAJOR__", "1"); options.predefinitions.emplace_back("__F18_MINOR__", "1"); options.predefinitions.emplace_back("__F18_PATCHLEVEL__", "1"); - options.predefinitions.emplace_back("__flang__", __FLANG__); - options.predefinitions.emplace_back("__flang_major__", __FLANG_MAJOR__); - options.predefinitions.emplace_back("__flang_minor__", __FLANG_MINOR__); + options.predefinitions.emplace_back("__flang__", FLANG_VERSION_STRING); options.predefinitions.emplace_back( - "__flang_patchlevel__", __FLANG_PATCHLEVEL__); + "__flang_major__", FLANG_VERSION_MAJOR_STRING); + options.predefinitions.emplace_back( + "__flang_minor__", FLANG_VERSION_MINOR_STRING); + options.predefinitions.emplace_back( + "__flang_patchlevel__", FLANG_VERSION_PATCHLEVEL_STRING); #if __x86_64__ options.predefinitions.emplace_back("__x86_64__", "1"); #endif diff --git a/flang/tools/f18/f18_version.h.in b/flang/tools/f18/f18_version.h.in deleted file mode 100644 --- a/flang/tools/f18/f18_version.h.in +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _F18_H_ -#define _F18_H_ - -#define __FLANG__ "1" -#define __FLANG_MAJOR__ "@LLVM_VERSION_MAJOR@" -#define __FLANG_MINOR__ "@LLVM_VERSION_MINOR@" -#define __FLANG_PATCHLEVEL__ "@LLVM_VERSION_PATCH@" - -#endif // _F18_H_