Changeset 608 in dev for trunk


Ignore:
Timestamp:
May 16, 2008, 9:40:59 PM (16 years ago)
Author:
dai_9181
Message:

静的リンクライブラリプロジェクトの作成(IDE側)に対応。

Location:
trunk/ab5.0/abdev
Files:
1 added
12 edited

Legend:

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

    r527 r608  
    639639        lstrcat(tempOutputFileName,temporary);
    640640        lstrcat(tempOutputFileName,temp2);
    641         if( compiler.IsStaticLibrary() )
     641        if( compiler.IsSll() )
    642642        {
    643643            if( program.IsDebugRun() || compiler.IsDebug() )
  • trunk/ab5.0/abdev/BasicCompiler_Common/Subroutine.cpp

    r603 r608  
    397397    }
    398398
    399     if( !compiler.IsStaticLibrary() )
     399    if( !compiler.IsSll() )
    400400    {
    401401        //_System_TypeBase_InitializeUserTypesは最後のほうでコンパイル
  • trunk/ab5.0/abdev/BasicCompiler_Common/include/Compiler.h

    r537 r608  
    33class Compiler
    44{
    5 public:
    6     // ターゲット
    7     enum TargetModuleType
    8     {
    9         Exe,
    10         Dll,
    11         StaticLibrary,
    12     };
    13 
    14 private:
    155    // ビルド成功のフラグ
    166    bool isBuildSuccessful;
     
    2010
    2111    // モジュール タイプ
    22     TargetModuleType targetModuleType;
     12    ActiveBasic::Common::TargetModuleType::EnumType targetModuleType;
    2313
    2414    // デバッグ ビルドかどうか
     
    4434        : isBuildSuccessful( false )
    4535        , pObjectModule( new ObjectModule )
    46         , targetModuleType( Exe )
     36        , targetModuleType( ActiveBasic::Common::TargetModuleType::Exe )
    4737        , isDebug( false )
    4838        , isUnicode( false )
     
    124114    bool IsExe() const
    125115    {
    126         if( targetModuleType == Exe )
     116        if( targetModuleType == ActiveBasic::Common::TargetModuleType::Exe )
    127117        {
    128118            return true;
     
    132122    bool IsDll() const
    133123    {
    134         if( targetModuleType == Dll )
     124        if( targetModuleType == ActiveBasic::Common::TargetModuleType::Dll )
    135125        {
    136126            return true;
     
    138128        return false;
    139129    }
    140     bool IsStaticLibrary() const
    141     {
    142         if( targetModuleType == StaticLibrary )
     130
     131    // スタティック リンク ライブラリをビルドする?
     132    bool IsSll() const
     133    {
     134        if( targetModuleType == ActiveBasic::Common::TargetModuleType::Sll )
    143135        {
    144136            return true;
     
    146138        return false;
    147139    }
    148     void SetTargetModuleType( TargetModuleType targetModuleType )
     140
     141    void SetTargetModuleType( ActiveBasic::Common::TargetModuleType::EnumType targetModuleType )
    149142    {
    150143        this->targetModuleType = targetModuleType;
  • trunk/ab5.0/abdev/BasicCompiler_Common/src/Program.cpp

    r519 r608  
    9292        {
    9393            // DLLとしてビルド
    94             compiler.SetTargetModuleType( Compiler::Dll );
     94            compiler.SetTargetModuleType( ActiveBasic::Common::TargetModuleType::Dll );
    9595        }
    9696        else if( cmdLine.GetCommand() == "static_library" )
    9797        {
    9898            // 静的リンクライブラリとしてビルド
    99             compiler.SetTargetModuleType( Compiler::StaticLibrary );
     99            compiler.SetTargetModuleType( ActiveBasic::Common::TargetModuleType::Sll );
    100100        }
    101101        else if( cmdLine.GetCommand() == "unicode" )
     
    118118            // '/' があった場合は '\\' に置換
    119119            Jenga::Common::StringReplace( includeDir, "/", "\\" );
     120        }
     121        else if( cmdLine.GetCommand() == "?" || cmdLine.GetCommand() == "help" )
     122        {
     123            std::cout << "TODO: ActiveBasic command line help." << std::endl;
    120124        }
    121125        else
  • trunk/ab5.0/abdev/ab_common/include/Environment.h

    r517 r608  
    1010        X86,
    1111        X64,
     12    };
     13};
     14
     15// ターゲット
     16struct TargetModuleType
     17{
     18    enum EnumType
     19    {
     20        Exe = 0,
     21        Dll,
     22        Sll,
    1223    };
    1324};
  • trunk/ab5.0/abdev/abdev/Common.h

    r601 r608  
    589589#define MT_EXE  0   //EXEモジュールタイプ
    590590#define MT_DLL  1   //DLLモジュールタイプ
     591#define MT_SLL  2   //SLLモジュールタイプ
    591592#define PJ_OP_SOURCE_MASK   0x00FFFFFF
    592593#define PJ_OP_MMSYSTEM      0x00000001
  • trunk/ab5.0/abdev/abdev/DialogBoxes.cpp

    r475 r608  
    6464#define TEXT_DIRECTX        "DirectXに対応したアプリケーションを作成します。2Dまたは3Dの描画を高速に行うことができ、ゲームアプリケーションなどの開発に最適です。"
    6565#define TEXT_DLL            "ダイナミック リンク ライブラリ(DLL)を作成します。"
     66#define TEXT_SLL            "静的 リンク ライブラリ(lib)を作成します。"
    6667#else
    6768//英語
     
    164165    else if(NewProjectInfo.dwTypeID==IDC_DLL){
    165166        lstrcpy(buffer+i,"ダイナミック リンク ライブラリ(DLL)を作成します。\r\n\r\n");
     167        i+=lstrlen(buffer+i);
     168        lstrcpy(buffer+i,"--- 以下のファイルが生成されます ---\r\n");
     169        i+=lstrlen(buffer+i);
     170        sprintf(buffer+i,"%s.pj … プロジェクト ファイル\r\n",NewProjectInfo.name);
     171        i+=lstrlen(buffer+i);
     172        sprintf(buffer+i,"%s.idx … インデックス ファイル\r\n",NewProjectInfo.name);
     173        i+=lstrlen(buffer+i);
     174        sprintf(buffer+i,"%s.ab … メイン ソースコード ファイル\r\n",NewProjectInfo.name);
     175        i+=lstrlen(buffer+i);
     176        sprintf(buffer+i,"%s.wrk … 作業状況の管理用\r\n",NewProjectInfo.name);
     177    }
     178    else if(NewProjectInfo.dwTypeID==IDC_SLL){
     179        lstrcpy(buffer+i,"静的 リンク ライブラリ(lib)を作成します。\r\n\r\n");
    166180        i+=lstrlen(buffer+i);
    167181        lstrcpy(buffer+i,"--- 以下のファイルが生成されます ---\r\n");
     
    426440
    427441                    SetDlgItemText(hwnd,IDC_HELPTEXT_OFBASE,TEXT_DLL);
     442                    EnableWindow(GetDlgItem(hwnd,IDC_SHOWHELLOWORLD),0);
     443                    return 1;
     444                case IDC_SLL:
     445                    AppImage_ShowOrHide(hwnd,LOWORD(wParam));
     446
     447                    SetDlgItemText(hwnd,IDC_HELPTEXT_OFBASE,TEXT_SLL);
    428448                    EnableWindow(GetDlgItem(hwnd,IDC_SHOWHELLOWORLD),0);
    429449                    return 1;
     
    468488                    else if(SendDlgItemMessage(hwnd,IDC_DLL,BM_GETCHECK,0,0))
    469489                        NewProjectInfo.dwTypeID=IDC_DLL;
     490                    else if(SendDlgItemMessage(hwnd,IDC_SLL,BM_GETCHECK,0,0))
     491                        NewProjectInfo.dwTypeID=IDC_SLL;
    470492
    471493                    //"Hello World!"を表示するか
  • trunk/ab5.0/abdev/abdev/ProjectControl.cpp

    r477 r608  
    748748    //////////////////////////////////////
    749749
     750    // 出力先拡張子
     751    const std::string outputFileExt
     752        = ( NewProjectInfo.dwTypeID == IDC_DLL ) ? ".dll"
     753        : ( NewProjectInfo.dwTypeID == IDC_SLL ) ? ".lib"
     754        : ".exe";
     755
    750756    //先頭の注釈
    751757    lstrcpy(buffer,"\' ActiveBasic Project file.\r\n\r\n");
     
    757763
    758764    //モジュールタイプ(EXEならば0、DLLならば1)
    759     if(NewProjectInfo.dwTypeID==IDC_DLL) lstrcpy(buffer+i,"#MODULETYPE=1\r\n\r\n");
    760     else lstrcpy(buffer+i,"#MODULETYPE=0\r\n\r\n");
     765    ActiveBasic::Common::TargetModuleType::EnumType moduleType
     766        = ( NewProjectInfo.dwTypeID == IDC_DLL ) ? ActiveBasic::Common::TargetModuleType::Dll
     767        : ( NewProjectInfo.dwTypeID == IDC_SLL ) ? ActiveBasic::Common::TargetModuleType::Sll
     768        : ActiveBasic::Common::TargetModuleType::Exe;
     769    lstrcpy(buffer+i,( (std::string)"#MODULETYPE=" + Jenga::Common::ToString( static_cast<int>(moduleType) ) + "\r\n\r\n" ).c_str());
    761770    i+=lstrlen(buffer+i);
    762771
     
    780789
    781790    //出力先(Release)
    782     if(NewProjectInfo.dwTypeID==IDC_DLL)
    783         sprintf(buffer+i,"#OUTPUT_RELEASE=.\\%s.dll\r\n\r\n",NewProjectInfo.name);
    784     else sprintf(buffer+i,"#OUTPUT_RELEASE=.\\%s.exe\r\n\r\n",NewProjectInfo.name);
     791    sprintf(buffer+i,"#OUTPUT_RELEASE=.\\%s%s\r\n\r\n",NewProjectInfo.name, outputFileExt.c_str());
    785792    i+=lstrlen(buffer+i);
    786793
    787794    //出力先(Debug)
    788     if(NewProjectInfo.dwTypeID==IDC_DLL)
    789         sprintf(buffer+i,"#OUTPUT_DEBUG=.\\%s.dll\r\n\r\n",NewProjectInfo.name);
    790     else sprintf(buffer+i,"#OUTPUT_DEBUG=.\\%s_debug.exe\r\n\r\n",NewProjectInfo.name);
     795    sprintf(buffer+i,"#OUTPUT_DEBUG=.\\%s_debug%s\r\n\r\n",NewProjectInfo.name, outputFileExt.c_str());
    791796    i+=lstrlen(buffer+i);
    792797
     
    948953        i+=lstrlen(buffer+i);
    949954    }
     955    else if( NewProjectInfo.dwTypeID == IDC_SLL )
     956    {
     957        buffer[0] = 0;
     958    }
    950959
    951960    //保存
     
    958967    else{
    959968        sprintf(temporary,"%s%s.ab",dir,NewProjectInfo.name);
    960         if(!WriteBuffer(temporary,buffer,i)) return;
     969        if(!WriteBuffer(temporary,buffer,lstrlen(buffer))) return;
    961970    }
    962971
  • trunk/ab5.0/abdev/abdev/abdev.vcproj

    r494 r608  
    27482748                <File
    27492749                    RelativePath=".\include\Program.h"
     2750                    >
     2751                </File>
     2752                <File
     2753                    RelativePath=".\include\ProjectManager.h"
    27502754                    >
    27512755                </File>
  • trunk/ab5.0/abdev/abdev/src/MainFrame.cpp

    r535 r608  
    958958            sprintf(temporary,"\"%s\" \"%s\" /run /wnd:%08x",temp2,temp3,m_hWnd);
    959959
    960         //DLLオプション
     960        // DLLオプション
    961961        if(ProjectInfo.dwModuleType==MT_DLL) lstrcat(temporary," /dll");
     962
     963        // SLLオプション
     964        if( ProjectInfo.dwModuleType == MT_SLL ) lstrcat( temporary, " /static_library" );
    962965
    963966        //Unicodeオプション
  • trunk/ab5.0/abdev/abdev/stdafx.h

    r519 r608  
    5454#include <MainFrame.h>
    5555#include <Program.h>
     56#include <ProjectManager.h>
  • trunk/ab5.0/abdev/compiler_x86/MakePeHdr.cpp

    r605 r608  
    439439        compiler.codeGenerator.op_call( pSub_System_GlobalArea );
    440440
    441         if( !compiler.IsStaticLibrary() )
     441        if( !compiler.IsSll() )
    442442        {
    443443            ///////////////////////////////////////
     
    506506
    507507
    508     if( compiler.IsStaticLibrary() )
     508    if( compiler.IsSll() )
    509509    {
    510510        // 静的リンクライブラリ
Note: See TracChangeset for help on using the changeset viewer.