diff --git a/.gitmodules b/.gitmodules index e69de29..d6694e3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,9 @@ +[submodule "third_party/build_infra"] + path = third_party/build_infra + url = http://192.168.1.75:3000/psc/build_infra.git +[submodule "third_party/CPP_Core"] + path = third_party/CPP_Core + url = http://192.168.1.75:3000/psc/CPP_Core.git +[submodule "third_party/Graphic_Core"] + path = third_party/Graphic_Core + url = http://192.168.1.75:3000/psc/Graphic_Core.git diff --git a/CMakeLists.txt b/CMakeLists.txt index b28b04f..d370db1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,21 @@ +if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_LIST_DIR}) + cmake_minimum_required(VERSION 3.16) + cmake_policy(SET CMP0141 NEW) + set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<$:Embedded>") + project(Radio) + set(Radio_VERSION 1.0.0) + set(CMAKE_CXX_STANDARD 20) + include(third_party/build_infra/start.cmake) + include(third_party/CPP_Core/main.cmake) + include(third_party/Graphic_Core/main.cmake) + include(${CMAKE_SOURCE_DIR}/main.cmake) + include(third_party/build_infra/end.cmake) +else () + +endif () + + + diff --git a/CMakeUserPresets.json b/CMakeUserPresets.json new file mode 100644 index 0000000..730e33c --- /dev/null +++ b/CMakeUserPresets.json @@ -0,0 +1,7 @@ +{ + "version": 4, + "include": [ + "toolchain/vs2022.json", + "toolchain/vs2019.json" + ] +} \ No newline at end of file diff --git a/main.cmake b/main.cmake index aee12fa..93d679d 100644 --- a/main.cmake +++ b/main.cmake @@ -5,21 +5,17 @@ set(dir "${module_dir}/radio") file(GLOB_RECURSE srcs "${dir}/*.c" "${dir}/*.cpp" "${dir}/*.h" "${dir}/*.hpp") add_executable(radio ${srcs}) target_link_libraries(radio PUBLIC YSGraphic_Core) -if(MSVC) +if (MSVC) target_compile_definitions(radio PRIVATE MockBackEnd) -endif() + target_compile_options(radio PRIVATE + /utf-8 + ) +endif () set_property(TARGET radio PROPERTY AUTOMOC ON) set_property(TARGET radio PROPERTY AUTOUIC ON) set_property(TARGET radio PROPERTY AUTORCC ON) - - - - - - - #_enable_project(example_qt_runtime_exe Qt5::Widgets Qt5::PrintSupport Qt5::QuickWidgets) # /opt/atk-dlrk356x-toolchain/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libmali.so #/opt/atk-dlrk356x-toolchain/aarch64-buildroot-linux-gnu/sysroot/usr/lib/libGLESv1_CM.so diff --git a/third_party/CPP_Core b/third_party/CPP_Core new file mode 160000 index 0000000..d784349 --- /dev/null +++ b/third_party/CPP_Core @@ -0,0 +1 @@ +Subproject commit d7843492bbc621ed799b56380787af344cc7d229 diff --git a/third_party/Graphic_Core b/third_party/Graphic_Core new file mode 160000 index 0000000..8c8cc87 --- /dev/null +++ b/third_party/Graphic_Core @@ -0,0 +1 @@ +Subproject commit 8c8cc8707b55592443fa0d6ccbeb31dc38047bfa diff --git a/third_party/build_infra b/third_party/build_infra new file mode 160000 index 0000000..8440aac --- /dev/null +++ b/third_party/build_infra @@ -0,0 +1 @@ +Subproject commit 8440aac659f74d851e64a86b4d22c5f6ef9ff03f diff --git a/toolchain/vs2019.cmake b/toolchain/vs2019.cmake new file mode 100644 index 0000000..e69de29 diff --git a/toolchain/vs2019.json b/toolchain/vs2019.json new file mode 100644 index 0000000..4693bba --- /dev/null +++ b/toolchain/vs2019.json @@ -0,0 +1,38 @@ +{ + "version": 10, + "cmakeMinimumRequired": { + "major": 3, + "minor": 21, + "patch": 0 + }, + "configurePresets": [ + { + "name": "vs2019", + "hidden": true, + "graphviz": "${sourceDir}/../build/${presetName}/graphviz/yc.dot", + "generator": "Ninja", + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/toolchain/vs2019.cmake" + }, + "vendor": { + "jetbrains.com/clion": { + "toolchain": "vs2019" + } + } + }, + { + "name": "vs2019_Debug", + "inherits": "vs2019", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "vs2019_Release", + "inherits": "vs2019", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + } + ] +} diff --git a/toolchain/vs2022.cmake b/toolchain/vs2022.cmake new file mode 100644 index 0000000..193d1b6 --- /dev/null +++ b/toolchain/vs2022.cmake @@ -0,0 +1,13 @@ + +set(dir "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64") + +set(CMAKE_CXX_COMPILER "${dir}/cl.bat") +set(CMAKE_C_COMPILER "${dir}/cl.bat") +set(CMAKE_LINKER "${dir}/link.bat") + +#set(CMAKE_CXX_COMPILER "${dir}/cl.exe") +#set(CMAKE_C_COMPILER "${dir}/cl.exe") +#set(CMAKE_LINKER "${dir}/link.exe") + +# [2/2] C:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\JetBrains\CLion 2025.3.4\bin\cmake\win\x64\bin\cmake.exe" -E vs_link_exe --msvc-ver=1944 --intdir=CMakeFiles\radio.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\mt.exe --manifests -- C:\PROGRA~1\MICROS~1\2022\ENTERP~1\VC\Tools\MSVC\1444~1.352\bin\Hostx64\x64\LINK_2~1.BAT /nologo @CMakeFiles\radio.rsp /out:radio.exe /implib:radio.lib /pdb:radio.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console && cd ." + diff --git a/toolchain/vs2022.json b/toolchain/vs2022.json new file mode 100644 index 0000000..bf55b51 --- /dev/null +++ b/toolchain/vs2022.json @@ -0,0 +1,38 @@ +{ + "version": 10, + "cmakeMinimumRequired": { + "major": 3, + "minor": 21, + "patch": 0 + }, + "configurePresets": [ + { + "name": "vs2022", + "hidden": true, + "graphviz": "${sourceDir}/../build/${presetName}/graphviz/yc.dot", + "generator": "Ninja", + "cacheVariables": { + "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/toolchain/vs2022.cmake" + }, + "vendor": { + "jetbrains.com/clion": { + "toolchain": "vs2022" + } + } + }, + { + "name": "vs2022_debug", + "inherits": "vs2022", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "vs2022_release", + "inherits": "vs2022", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + } + ] +} \ No newline at end of file