Permalink
Browse files

core, refactor: separate fibjs library for reuse.

  • Loading branch information...
xicilion committed May 30, 2018
1 parent 5111e70 commit 545c9bed902ec037c5690c374b09fec26fd107a9
View
7 build
@@ -193,3 +193,10 @@ if [ $? != 0 ]; then
exit 1
fi
cd ..
cd fibjs/program
sh build $BUILD_TYPE $TARGET_ARCH $CI
if [ $? != 0 ]; then
exit 1
fi
cd ../..
View
@@ -72,7 +72,7 @@ msbuild fibjs.sln /t:Build /p:Configuration=!BUILD_TYPE!;Platform=!Platform!;Pla
if "!BUILD_TYPE!"=="release" (
cd bin\Windows_!TARGET_ARCH!_!BUILD_TYPE!
fibjs ../../fibjs/gen_install.js
fibjs ../../fibjs/program/gen_install.js
cd ..\..
cd installer
msbuild installer.sln /t:Build /p:Configuration=Release;Platform=!Platform!;PlatformToolset=v141!XP! !MT!
View
@@ -3,8 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Blend for Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fibjs", "fibjs\fibjs.vcxproj", "{05654A7E-DBAF-4211-886A-C23565833D05}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fibjs", "fibjs\program\fibjs.vcxproj", "{05654A7E-DBAF-4211-886A-C23565833D05}"
ProjectSection(ProjectDependencies) = postProject
{238FDB2A-C47D-44E2-94A3-D0FA2BF3C965} = {238FDB2A-C47D-44E2-94A3-D0FA2BF3C965}
{238FDB2A-C47D-44E0-94A2-D0FA2BF3C964} = {238FDB2A-C47D-44E0-94A2-D0FA2BF3C964}
{1F77AB58-706B-4BB5-BE73-00000000009D} = {1F77AB58-706B-4BB5-BE73-00000000009D}
{1F77AB58-706B-4BB5-BE73-0000000000C8} = {1F77AB58-706B-4BB5-BE73-0000000000C8}
@@ -28,6 +29,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fibjs", "fibjs\fibjs.vcxpro
{1F77AB58-706B-4BB5-BE73-000110032391} = {1F77AB58-706B-4BB5-BE73-000110032391}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fiblib", "fibjs\fibjs.vcxproj", "{238FDB2A-C47D-44E2-94A3-D0FA2BF3C965}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "exlib", "vender\exlib\exlib.vcxproj", "{1F77AB58-706B-4BB5-BE73-0000000E211B}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "exif", "vender\exif\exif.vcxproj", "{238FDB2A-C47D-44E0-94A2-D0FA2BF3C964}"
@@ -74,8 +77,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jssdk", "vender\jssdk\jssdk
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtest", "vender\gtest\gtest.vcxproj", "{1F77AB58-706B-4BB5-BE73-00111039117E}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fibjs_gui", "fibjs\fibjs_gui.vcxproj", "{E86C788B-0810-4E08-A184-421054A3FD03}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fibjs_gui", "fibjs\program\fibjs_gui.vcxproj", "{E86C788B-0810-4E08-A184-421054A3FD03}"
ProjectSection(ProjectDependencies) = postProject
{238FDB2A-C47D-44E2-94A3-D0FA2BF3C965} = {238FDB2A-C47D-44E2-94A3-D0FA2BF3C965}
{238FDB2A-C47D-44E0-94A2-D0FA2BF3C964} = {238FDB2A-C47D-44E0-94A2-D0FA2BF3C964}
{1F77AB58-706B-4BB5-BE73-00000000009D} = {1F77AB58-706B-4BB5-BE73-00000000009D}
{1F77AB58-706B-4BB5-BE73-0000000000C8} = {1F77AB58-706B-4BB5-BE73-0000000000C8}
@@ -438,6 +442,18 @@ Global
{58DE1AFE-3183-4193-963C-B80700000000}.Release|Win32.Build.0 = Release|Win32
{58DE1AFE-3183-4193-963C-B80700000000}.Release|x64.ActiveCfg = Release|x64
{58DE1AFE-3183-4193-963C-B80700000000}.Release|x64.Build.0 = Release|x64
{238FDB2A-C47D-44E2-94A3-D0FA2BF3C965}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{238FDB2A-C47D-44E2-94A3-D0FA2BF3C965}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{238FDB2A-C47D-44E2-94A3-D0FA2BF3C965}.Debug|Win32.ActiveCfg = Debug|Win32
{238FDB2A-C47D-44E2-94A3-D0FA2BF3C965}.Debug|Win32.Build.0 = Debug|Win32
{238FDB2A-C47D-44E2-94A3-D0FA2BF3C965}.Debug|x64.ActiveCfg = Debug|x64
{238FDB2A-C47D-44E2-94A3-D0FA2BF3C965}.Debug|x64.Build.0 = Debug|x64
{238FDB2A-C47D-44E2-94A3-D0FA2BF3C965}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{238FDB2A-C47D-44E2-94A3-D0FA2BF3C965}.Release|Mixed Platforms.Build.0 = Release|Win32
{238FDB2A-C47D-44E2-94A3-D0FA2BF3C965}.Release|Win32.ActiveCfg = Release|Win32
{238FDB2A-C47D-44E2-94A3-D0FA2BF3C965}.Release|Win32.Build.0 = Release|Win32
{238FDB2A-C47D-44E2-94A3-D0FA2BF3C965}.Release|x64.ActiveCfg = Release|x64
{238FDB2A-C47D-44E2-94A3-D0FA2BF3C965}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
View
@@ -13,10 +13,10 @@ if(CCACHE_FOUND)
endif(CCACHE_FOUND)
file(GLOB_RECURSE src_list "src/*.c*")
add_executable(fibjs ${src_list})
add_library(fibjs ${src_list})
set(BIN_DIR ${PROJECT_SOURCE_DIR}/../bin/${OS}_${ARCH}_${BUILD_TYPE})
set(EXECUTABLE_OUTPUT_PATH ${BIN_DIR})
set(LIBRARY_OUTPUT_PATH ${BIN_DIR})
include(CheckIncludeFiles)
include(CheckCSourceCompiles)
@@ -37,21 +37,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tools/gitinfo.h.in ${CMAKE_CURRENT_BI
set(flags "-fsigned-char -fmessage-length=0 -fdata-sections -ffunction-sections -fno-exceptions -D_FILE_OFFSET_BITS=64")
set(ccflags "-std=c++11")
set(link_flags " ")
if(${OS} STREQUAL "Darwin")
set(link_flags "${link_flags} -mmacosx-version-min=10.9 -framework Carbon -framework IOKit")
set(flags "${flags} -mmacosx-version-min=10.9")
target_link_libraries(fibjs dl iconv stdc++)
endif()
if(${OS} STREQUAL "Linux")
target_link_libraries(fibjs dl rt)
endif()
if(${OS} STREQUAL "FreeBSD")
find_library(execinfo execinfo "/usr/local/lib" "/usr/lib")
target_link_libraries(fibjs ${execinfo})
endif()
if(${BUILD_TYPE} STREQUAL "release")
@@ -63,35 +51,15 @@ if(${BUILD_TYPE} STREQUAL "release")
set(flags "${flags} -fomit-frame-pointer")
endif()
set(link_flags "${link_flags} ${BUILD_OPTION}")
add_definitions(-DNDEBUG=1)
if(HAVE_GLIB_C_225_H)
set(link_flags "${link_flags} -Wl,--wrap=memcpy")
endif()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(link_flags "${link_flags} -static-libgcc -static-libstdc++ -Wl,--no-as-needed")
endif()
endif()
if(${BUILD_TYPE} STREQUAL "debug")
set(flags "${flags} -g -O0 ${BUILD_OPTION} -Wall -Wno-overloaded-virtual")
set(link_flags "${link_flags} ${BUILD_OPTION}")
add_definitions(-DDEBUG=1)
endif()
set(CMAKE_C_FLAGS "${flags}")
set(CMAKE_CXX_FLAGS "${flags} ${ccflags}")
include_directories("${PROJECT_SOURCE_DIR}/include" "${PROJECT_SOURCE_DIR}/../vender" "${PROJECT_SOURCE_DIR}/../vender/v8" "${PROJECT_SOURCE_DIR}/../vender/v8/include" "${PROJECT_SOURCE_DIR}/../vender/mbedtls" "${PROJECT_SOURCE_DIR}/../vender/zlib/include" "${CMAKE_CURRENT_BINARY_DIR}")
set(libs expat gumbo gd tiff jpeg png webp zlib leveldb snappy ev pcre sqlite mongo umysql uuid exif mbedtls v8 zmq unzip editline exlib)
foreach(lib ${libs})
target_link_libraries(fibjs "${BIN_DIR}/lib${lib}.a")
endforeach()
target_link_libraries(fibjs pthread)
set_target_properties(fibjs PROPERTIES LINK_FLAGS ${link_flags})
View
@@ -179,25 +179,4 @@ if [ $? != 0 ]; then
exit 1
fi
if [ "${BUILD_TYPE}" = "release" ]; then
cd "${BIN_PATH}"
cp "${FIBJS_PATH}/installer.txt" "installer.sh"
tar -zcf fibjs.tar.gz fibjs
echo '[100%] Built target fibjs.tar.gz'
cat fibjs.tar.gz >> installer.sh
chmod 777 installer.sh
echo '[100%] Built target install.sh'
if [ $TARGET_OS = "Linux" ]; then
echo ''
echo '==== GLIBC ===='
${BUILD_PREFIX}objdump fibjs -p | grep GLIBC_[0-9.]* -o | sort | uniq
fi
if [ "${CI}" = "ci" ]; then
xz -cz -T2 fibjs > fibjs.xz
echo '[100%] Built target fibjs.xz'
fi
fi
cd "${FIBJS_PATH}"
View
@@ -18,80 +18,6 @@
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(SolutionDir)vender\exif\exif.vcxproj">
<Project>{238FDB2A-C47D-44E0-94A2-D0FA2BF3C964}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\exlib\exlib.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-0000000E211B}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\expat\expat.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-000000E29AC9}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\gd\gd.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-00000000009D}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\gumbo\gumbo.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-00000009C3B0}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\jpeg\jpeg.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-0000000019E9}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\leveldb\leveldb.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-000001ECE1DB}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\mongo\mongo.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-000000030C90}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\pcre\pcre.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-000000009C2E}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\png\png.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-0000000009C9}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\mbedtls\mbedtls.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-0000901A2331}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\snappy\snappy.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-0000003CA997}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\sqlite\sqlite.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-00000039117E}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\tiff\tiff.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-000000007155}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\webp\webp.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-000000003BED}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\umysql\umysql.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-000000032391}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\unzip\unzip.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-000110032391}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\uuid\uuid.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-00000000CC1D}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\winiconv\winiconv.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-0000031CC0CC}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\zlib\zlib.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-00000000211B}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\zmq\zmq.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-00000000239b}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\v8\v8.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-0000000000C8}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\jssdk\jssdk.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-00110039117e}</Project>
</ProjectReference>
<ProjectReference Include="$(SolutionDir)vender\gtest\gtest.vcxproj">
<Project>{1F77AB58-706B-4BB5-BE73-00111039117e}</Project>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\AsyncCall.h" />
<ClInclude Include="include\AsyncIO.h" />
@@ -356,16 +282,12 @@
<ClInclude Include="src\gui\windows\WebView.h" />
<ClInclude Include="src\sandbox\loaders\loaders.h" />
</ItemGroup>
<ItemGroup>
<None Include="include\object_async.inl" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\base\Runtime.cpp" />
<ClCompile Include="src\base\Variant.cpp" />
<ClCompile Include="src\base\acPool.cpp" />
<ClCompile Include="src\base\date.cpp" />
<ClCompile Include="src\base\date_cache.cpp" />
<ClCompile Include="src\base\fibjs.cpp" />
<ClCompile Include="src\base\fibjs_main.cpp" />
<ClCompile Include="src\base\fuck_sym.cpp" />
<ClCompile Include="src\base\opt_tools.cpp" />
@@ -541,39 +463,33 @@
<ClCompile Include="src\zip\ZipFile.cpp" />
<ClCompile Include="src\zip\zlib.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="res\fibjs.rc" />
</ItemGroup>
<ItemGroup>
<Image Include="res\fibjs.ico" />
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{05654A7E-DBAF-4211-886A-C23565833D05}</ProjectGuid>
<ProjectGuid>{238FDB2A-C47D-44E2-94A3-D0FA2BF3C965}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>fibjs</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
@@ -628,9 +544,8 @@
<DisableSpecificWarnings>4091;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>winmm.lib;ws2_32.lib;psapi.lib;dbghelp.lib;shlwapi.lib;urlmon.lib;userenv.lib;advapi32.lib;Kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Manifest>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
@@ -649,9 +564,8 @@
<DisableSpecificWarnings>4091;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>winmm.lib;ws2_32.lib;psapi.lib;dbghelp.lib;shlwapi.lib;urlmon.lib;userenv.lib;advapi32.lib;Kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Manifest>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
@@ -673,11 +587,10 @@
<DisableSpecificWarnings>4091;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>winmm.lib;ws2_32.lib;psapi.lib;dbghelp.lib;shlwapi.lib;urlmon.lib;userenv.lib;advapi32.lib;Kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Manifest>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
@@ -701,11 +614,10 @@
<DisableSpecificWarnings>4091;%(DisableSpecificWarnings)</DisableSpecificWarnings>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>winmm.lib;ws2_32.lib;psapi.lib;dbghelp.lib;shlwapi.lib;urlmon.lib;userenv.lib;advapi32.lib;Kernel32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<Manifest>
<EnableDpiAwareness>PerMonitorHighDPIAware</EnableDpiAwareness>
@@ -920,9 +920,6 @@
<ClCompile Include="src\base\date_cache.cpp">
<Filter>Source Files\base</Filter>
</ClCompile>
<ClCompile Include="src\base\fibjs.cpp">
<Filter>Source Files\base</Filter>
</ClCompile>
<ClCompile Include="src\base\fibjs_main.cpp">
<Filter>Source Files\base</Filter>
</ClCompile>
Oops, something went wrong.

0 comments on commit 545c9be

Please sign in to comment.