Ignore:
Timestamp:
Mar 31, 2008, 12:33:24 PM (16 years ago)
Author:
dai_9181
Message:

デプロイ時にcore.lib/cored.libのビルドもできるようにした。

Location:
trunk/ab5.0/abdev/BasicCompiler_Common
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.cpp

    r471 r472  
    574574}
    575575
    576 #include <fcntl.h>
    577 #include <io.h>
    578 
    579576int main()
    580577{
     
    753750            MainThread(0);
    754751
    755             ExitProcess( 0 );
     752            trace("Complete ActiveBasic Compiler!");
     753
     754            ExitProcess( program.GetExitCode() );
    756755            return 0;
    757756        }
     
    798797    trace("Complete ActiveBasic Compiler!");
    799798
    800     ExitProcess( 0 );
     799    ExitProcess( program.GetExitCode() );
    801800
    802801    return 0;
  • trunk/ab5.0/abdev/BasicCompiler_Common/MakeExe.cpp

    r467 r472  
    181181                else
    182182                {
    183                     compiler.messenger.Output( ((string)"\"" + path.GetFullPath() + "\" ファイルが壊れています。").c_str() );
     183                    compiler.errorMessenger.Output( 203, path.GetFullPath() );
    184184                    isSuccessfulLoadStaticLinkLibrary = false;
    185185                }
     
    187187            else
    188188            {
    189                 compiler.messenger.Output( ((string)"\"" + path.GetFullPath() + "\" ファイルが存在しません。").c_str() );
     189                compiler.errorMessenger.Output( 202, path.GetFullPath() );
    190190                isSuccessfulLoadStaticLinkLibrary = false;
    191191            }
     
    204204                else
    205205                {
    206                     compiler.messenger.Output( ((string)"\"" + path.GetFullPath() + "\" ファイルが壊れています。").c_str() );
     206                    compiler.errorMessenger.Output( 203, path.GetFullPath() );
    207207                    isSuccessfulLoadStaticLinkLibrary = false;
    208208                }
     
    210210            else
    211211            {
    212                 compiler.messenger.Output( ((string)"\"" + path.GetFullPath() + "\" ファイルが存在しません。").c_str() );
     212                compiler.errorMessenger.Output( 202, path.GetFullPath() );
    213213                isSuccessfulLoadStaticLinkLibrary = false;
    214214            }
     
    280280    SetDlgItemText(hMainDlg,IDOK,STRING_CLOSE);
    281281
     282    // エラーがない場合はビルド成功とする
     283    if( !compiler.errorMessenger.HasError() )
     284    {
     285        // ビルド成功
     286        compiler.BuildSuccessful();
     287    }
     288
    282289#ifdef _DEBUG
    283290    // デバッグモードのときはダイアログが隠れている
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h

    r465 r472  
    2525
    2626private:
     27    // ビルド成功のフラグ
     28    bool isBuildSuccessful;
     29
    2730    // モジュール名
    2831    std::string moduleName;
     
    4750
    4851    Compiler()
    49         : pObjectModule( new ObjectModule )
     52        : isBuildSuccessful( false )
     53        , pObjectModule( new ObjectModule )
    5054        , pNowObjectModule( pObjectModule )
    5155        , targetModuleType( Exe )
     
    7175    void StaticLink( ObjectModules &staticLibraries );
    7276
     77    // ビルド成功のフラグ
     78    bool IsBuildSuccessful() const
     79    {
     80        return isBuildSuccessful;
     81    }
     82    void BuildSuccessful()
     83    {
     84        isBuildSuccessful = true;
     85    }
     86
    7387    // モジュール名
    7488    void SetModuleName( const std::string &moduleName )
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Messenger.h

    r465 r472  
    6363public:
    6464    void Output( const ErrorInfo &errorInfo );
    65     void Output( int errorCode, const std::string &keyword, int sourceIndex );
    66     void Output( int errorCode, const char *keyword, int sourceIndex );
     65    void Output( int errorCode, const std::string &keyword, int sourceIndex = -1 );
     66    void Output( int errorCode, const char *keyword, int sourceIndex = -1 );
    6767    void OutputFatalError();
    6868
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Program.h

    r471 r472  
    8686        this->includeDir = includeDir;
    8787    }
     88
     89    int GetExitCode() const;
    8890};
    8991
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Messenger.cpp

    r468 r472  
    256256    if(errorCode==200) sprintf(msg,"\"%s\" 未解決です (リンク エラー)。",tempKeyWord);
    257257    if(errorCode==201) sprintf(msg,"\"%s\" の読み込みに失敗。",tempKeyWord);
     258    if(errorCode==202) sprintf(msg,"\"%s\" は存在しません。",tempKeyWord);
     259    if(errorCode==203) sprintf(msg,"\"%s\" は存在しますが、読み込めません(古いバージョンのコンパイラでビルドされた可能性があります)。",tempKeyWord);
    258260
    259261    //原因不明
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Program.cpp

    r471 r472  
    2626    {
    2727        // 先頭に無名コマンドがきた場合、ソースファイル名として認識する
    28         Program::SetSourceFilePath( cmdLines[cmdLineIndex].GetParameter() );
     28        std::string tempParam = cmdLines[cmdLineIndex].GetParameter();
     29        Program::SetSourceFilePath( Jenga::Common::StringReplace( tempParam, "/", "\\" ) );
    2930
    3031        cmdLineIndex ++;
     
    4041        {
    4142            // 二番目にも無名コマンドがきた場合、ソースファイル名として認識する
    42             SetOutputFilePath( cmdLines[cmdLineIndex].GetParameter() );
     43            std::string tempParam = cmdLines[cmdLineIndex].GetParameter();
     44            SetOutputFilePath( Jenga::Common::StringReplace( tempParam, "/", "\\" ) );
    4345
    4446            cmdLineIndex ++;
     
    102104        {
    103105            //インクルード ディレクトリ
    104             includeDir = cmdLine.GetParameter();
     106            includeDir = cmdLines[cmdLineIndex].GetParameter();
     107
     108            // '/' があった場合は '\\' に置換
     109            Jenga::Common::StringReplace( includeDir, "/", "\\" );
    105110        }
    106111        else
     
    119124    return true;
    120125}
     126
     127int Program::GetExitCode() const
     128{
     129    if( !compiler.IsBuildSuccessful() )
     130    {
     131        // ビルドに失敗
     132        return 1;
     133    }
     134
     135    // ビルドに成功
     136    return 0;
     137}
Note: See TracChangeset for help on using the changeset viewer.