1h1cpp support 3 platform name

This commit is contained in:
idea4good
2019-08-26 11:16:39 +08:00
parent 7f9f982ec7
commit 0072e6e3e3

View File

@@ -22,7 +22,8 @@ cd ..
cat core.h widgets.h > GuiLiteRaw.h cat core.h widgets.h > GuiLiteRaw.h
rm core.h widgets.h rm core.h widgets.h
# build GuiLite.cpp # build GuiLite-xxx.cpp
cppFileName="GuiLite-win.cpp"
cd core cd core
cat *.cpp > core.cpp cat *.cpp > core.cpp
mv core.cpp ../ mv core.cpp ../
@@ -34,6 +35,7 @@ do
1) 1)
echo "Choose 1" echo "Choose 1"
cat *linux*.cpp > adapter.cpp cat *linux*.cpp > adapter.cpp
cppFileName="GuiLite-linux.cpp"
break break
;; ;;
2) 2)
@@ -44,6 +46,7 @@ do
3) 3)
echo "Choose 3" echo "Choose 3"
cat *unknow*.cpp > adapter.cpp cat *unknow*.cpp > adapter.cpp
cppFileName="GuiLite-unknow.cpp"
break break
;; ;;
*) *)
@@ -63,21 +66,21 @@ cd ..
cat core.cpp adapter.cpp widgets.cpp > GuiLiteRaw.cpp cat core.cpp adapter.cpp widgets.cpp > GuiLiteRaw.cpp
rm core.cpp adapter.cpp widgets.cpp rm core.cpp adapter.cpp widgets.cpp
# remove include core_include widgets_include from GuiLite.cpp # remove include core_include widgets_include from GuiLiteRaw.cpp
sed '/^#include.*core_include\|widgets_include.*/d' GuiLiteRaw.cpp > GuiLiteNoInclude.cpp sed '/^#include.*core_include\|widgets_include.*/d' GuiLiteRaw.cpp > GuiLiteNoInclude.cpp
# include GuiLite.h to GuiLite.cpp # include GuiLite.h to GuiLiteNoInclude.cpp
sed -i '1s/^/#include "GuiLite.h" /' GuiLiteNoInclude.cpp sed -i '1s/^/#include "GuiLite.h" /' GuiLiteNoInclude.cpp
# Delete empty lines or blank lines # Delete empty lines or blank lines
sed '/^$/d' GuiLiteRaw.h > GuiLite.h sed '/^$/d' GuiLiteRaw.h > GuiLite.h
sed '/^$/d' GuiLiteNoInclude.cpp > GuiLite.cpp sed '/^$/d' GuiLiteNoInclude.cpp > $cppFileName
# Verify # Verify
gcc -c GuiLite.cpp gcc -c $cppFileName
# clean # clean
rm GuiLiteRaw.h GuiLiteRaw.cpp GuiLiteNoInclude.cpp rm GuiLiteRaw.h GuiLiteRaw.cpp GuiLiteNoInclude.cpp
echo "Done!" echo "Done!"
echo "You could find GuiLite.h/GuiLite.cpp in this folder" echo "You could find GuiLite.h/$cppFileName in this folder"