mirror of
https://gitee.com/idea4good/GuiLite.git
synced 2026-01-02 04:17:19 +08:00
merge guilte-xxx.cpp into guilite.cpp
This commit is contained in:
@@ -1,15 +1,8 @@
|
||||
./.sync.sh 1h1cpp
|
||||
|
||||
echo "Merge GuiLite source code into: 1 hearder & 1 source file"
|
||||
echo ""
|
||||
echo "Choose 1: Build for Linux"
|
||||
echo "Choose 2: Build for Windows"
|
||||
echo "Choose 3: Build for None OS or any OS"
|
||||
echo "Choose 4: exit"
|
||||
echo "Flatten source code into: GuiLite.h/GuiLite.cpp"
|
||||
|
||||
read -p "Please input:[1-3]:" input
|
||||
|
||||
# build GuiLite.h
|
||||
# build GuiLiteRaw.h
|
||||
cd core_include
|
||||
cat api.h cmd_target.h rect.h resource.h theme.h surface.h display.h word.h bitmap.h wnd.h audio.h > core.h
|
||||
mv core.h ../
|
||||
@@ -22,40 +15,13 @@ cd ..
|
||||
cat core.h widgets.h > GuiLiteRaw.h
|
||||
rm core.h widgets.h
|
||||
|
||||
# build GuiLite-xxx.cpp
|
||||
cppFileName="GuiLite-win.cpp"
|
||||
# build GuiLiteRaw.cpp
|
||||
cd core
|
||||
cat *.cpp > core.cpp
|
||||
mv core.cpp ../
|
||||
|
||||
cd adapter
|
||||
|
||||
while :
|
||||
do
|
||||
case $input in
|
||||
1)
|
||||
echo "Choose 1"
|
||||
cat *linux*.cpp > adapter.cpp
|
||||
cppFileName="GuiLite-linux.cpp"
|
||||
break
|
||||
;;
|
||||
2)
|
||||
echo "Choose 2"
|
||||
cat *win*.cpp > adapter.cpp
|
||||
break
|
||||
;;
|
||||
3)
|
||||
echo "Choose 3"
|
||||
cat *unknow*.cpp > adapter.cpp
|
||||
cppFileName="GuiLite-unknow.cpp"
|
||||
break
|
||||
;;
|
||||
*)
|
||||
rm ../../GuiLiteRaw.h ../../core.cpp
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
cat *.cpp > adapter.cpp
|
||||
mv adapter.cpp ../../
|
||||
|
||||
cd ../../widgets
|
||||
@@ -74,13 +40,13 @@ sed -i '1s/^/#include "GuiLite.h" /' GuiLiteNoInclude.cpp
|
||||
|
||||
# Delete empty lines or blank lines
|
||||
sed '/^$/d' GuiLiteRaw.h > GuiLite.h
|
||||
sed '/^$/d' GuiLiteNoInclude.cpp > $cppFileName
|
||||
sed '/^$/d' GuiLiteNoInclude.cpp > GuiLite.cpp
|
||||
|
||||
# Verify
|
||||
gcc -c $cppFileName
|
||||
gcc -c GuiLite.cpp
|
||||
|
||||
# clean
|
||||
rm GuiLiteRaw.h GuiLiteRaw.cpp GuiLiteNoInclude.cpp
|
||||
|
||||
echo "Done!"
|
||||
echo "You could find GuiLite.h/$cppFileName in this folder"
|
||||
echo "You could find GuiLite.h/GuiLite.cpp in this folder"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#if (!defined _WIN32) && (!defined WIN32) && (!defined _WIN64) && (!defined WIN64) && (!defined __linux__) && && (!defined __APPLE__)
|
||||
#if (!defined _WIN32) && (!defined WIN32) && (!defined _WIN64) && (!defined WIN64) && (!defined __linux__) && (!defined __APPLE__)
|
||||
|
||||
#include "../../core_include/api.h"
|
||||
#include <stdio.h>
|
||||
|
||||
Reference in New Issue
Block a user