Skip to content

Commit

Permalink
Move settings to another target
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejnau committed Jan 16, 2024
1 parent 2598dda commit 9f09689
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/Apps/CoreDxrTriangle/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "AppBox/AppBox.h"
#include "AppBox/ArgsParser.h"
#include "AppSettings/ArgsParser.h"
#include "Instance/Instance.h"
#include "Utilities/Common.h"

Expand Down
2 changes: 1 addition & 1 deletion src/Apps/CoreTriangle/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "AppBox/AppBox.h"
#include "AppBox/ArgsParser.h"
#include "AppSettings/ArgsParser.h"
#include "Instance/Instance.h"

int main(int argc, char* argv[])
Expand Down
2 changes: 1 addition & 1 deletion src/Modules/AppBox/AppBox.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once
#include "ApiType/ApiType.h"
#include "AppBox/InputEvents.h"
#include "AppBox/Settings.h"
#include "AppBox/WindowEvents.h"
#include "AppLoop/AppSize.h"
#include "AppSettings/Settings.h"

#include <GLFW/glfw3.h>

Expand Down
6 changes: 2 additions & 4 deletions src/Modules/AppBox/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ endif()

list(APPEND headers
AppBox.h
ArgsParser.h
InputEvents.h
Settings.h
WindowEvents.h
)

list(APPEND sources
AppBox.cpp
ArgsParser.cpp
)

add_library(AppBox ${headers} ${sources})

target_link_libraries(AppBox
glfw
AppSettings
FlyCube
glfw
)

if (APPLE)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#include "AppBox/ArgsParser.h"
#include "AppSettings/ArgsParser.h"

#include <string>
#include <vector>

namespace {

std::vector<ApiType> GetSupportedApis()
{
std::vector<ApiType> res;
Expand All @@ -18,6 +20,8 @@ std::vector<ApiType> GetSupportedApis()
return res;
}

} // namespace

Settings ParseArgs(int argc, char* argv[])
{
Settings settings;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#pragma once
#include "AppBox/Settings.h"

#include <cstdint>
#include "AppSettings/Settings.h"

Settings ParseArgs(int argc, char* argv[]);
23 changes: 23 additions & 0 deletions src/Modules/AppSettings/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
if (IOS_OR_TVOS)
return()
endif()

list(APPEND headers
ArgsParser.h
Settings.h
)

list(APPEND sources
ArgsParser.cpp
)

add_library(AppSettings ${headers} ${sources})

target_include_directories(AppSettings
PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}/.."
)

target_link_libraries(AppSettings FlyCube)

set_target_properties(AppSettings PROPERTIES FOLDER "Modules")
File renamed without changes.
1 change: 1 addition & 0 deletions src/Modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ if (NOT IOS_OR_TVOS)
endif()

add_subdirectory(AppLoop)
add_subdirectory(AppSettings)
add_subdirectory(Utilities)

0 comments on commit 9f09689

Please sign in to comment.