Skip to content

Commit

Permalink
build: Only add language package specific source and header files to …
Browse files Browse the repository at this point in the history
…build when enabled

* removed preprocessor guards in language specific files to avoid "file has no symbols" warning
* separated files into multiple lists in lib and lib_gui CMakeLists.txt for each language package
  • Loading branch information
egraether committed Nov 14, 2019
1 parent 634e09d commit bb40bcf
Show file tree
Hide file tree
Showing 81 changed files with 250 additions and 550 deletions.
107 changes: 64 additions & 43 deletions src/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -344,39 +344,6 @@ add_files(
settings/migration/SettingsMigrationMoveKey.h
settings/migration/SettingsMigrator.h

settings/source_group/component/java/SourceGroupSettingsWithClasspath.cpp
settings/source_group/component/java/SourceGroupSettingsWithClasspath.h
settings/source_group/component/java/SourceGroupSettingsWithJavaGradle.cpp
settings/source_group/component/java/SourceGroupSettingsWithJavaGradle.h
settings/source_group/component/java/SourceGroupSettingsWithJavaMaven.cpp
settings/source_group/component/java/SourceGroupSettingsWithJavaMaven.h
settings/source_group/component/java/SourceGroupSettingsWithJavaStandard.cpp
settings/source_group/component/java/SourceGroupSettingsWithJavaStandard.h
settings/source_group/component/java/SourceGroupSettingsWithSourceExtensionsJava.h

settings/source_group/component/cxx/SourceGroupSettingsWithCppStandard.cpp
settings/source_group/component/cxx/SourceGroupSettingsWithCppStandard.h
settings/source_group/component/cxx/SourceGroupSettingsWithCStandard.cpp
settings/source_group/component/cxx/SourceGroupSettingsWithCStandard.h
settings/source_group/component/cxx/SourceGroupSettingsWithCxxCdbPath.cpp
settings/source_group/component/cxx/SourceGroupSettingsWithCxxCdbPath.h
settings/source_group/component/cxx/SourceGroupSettingsWithCxxCodeblocksPath.cpp
settings/source_group/component/cxx/SourceGroupSettingsWithCxxCodeblocksPath.h
settings/source_group/component/cxx/SourceGroupSettingsWithCxxCrossCompilationOptions.cpp
settings/source_group/component/cxx/SourceGroupSettingsWithCxxCrossCompilationOptions.h
settings/source_group/component/cxx/SourceGroupSettingsWithCxxPathsAndFlags.cpp
settings/source_group/component/cxx/SourceGroupSettingsWithCxxPathsAndFlags.h
settings/source_group/component/cxx/SourceGroupSettingsWithCxxPchOptions.cpp
settings/source_group/component/cxx/SourceGroupSettingsWithCxxPchOptions.h
settings/source_group/component/cxx/SourceGroupSettingsWithIndexedHeaderPaths.cpp
settings/source_group/component/cxx/SourceGroupSettingsWithIndexedHeaderPaths.h
settings/source_group/component/cxx/SourceGroupSettingsWithSourceExtensionsC.h
settings/source_group/component/cxx/SourceGroupSettingsWithSourceExtensionsCpp.h

settings/source_group/component/python/SourceGroupSettingsWithPythonEnvironmentPath.cpp
settings/source_group/component/python/SourceGroupSettingsWithPythonEnvironmentPath.h
settings/source_group/component/python/SourceGroupSettingsWithSourceExtensionsPython.h

settings/source_group/component/SourceGroupSettingsWithCustomCommand.cpp
settings/source_group/component/SourceGroupSettingsWithCustomCommand.h
settings/source_group/component/SourceGroupSettingsWithExcludeFilters.cpp
Expand All @@ -387,16 +354,6 @@ add_files(
settings/source_group/component/SourceGroupSettingsWithSourcePaths.cpp
settings/source_group/component/SourceGroupSettingsWithSourcePaths.h

settings/source_group/type/SourceGroupSettingsCEmpty.h
settings/source_group/type/SourceGroupSettingsCppEmpty.h
settings/source_group/type/SourceGroupSettingsCustomCommand.h
settings/source_group/type/SourceGroupSettingsCxxCdb.h
settings/source_group/type/SourceGroupSettingsCxxCdbVs.h
settings/source_group/type/SourceGroupSettingsCxxCodeblocks.h
settings/source_group/type/SourceGroupSettingsJavaEmpty.h
settings/source_group/type/SourceGroupSettingsJavaGradle.h
settings/source_group/type/SourceGroupSettingsJavaMaven.h
settings/source_group/type/SourceGroupSettingsPythonEmpty.h
settings/source_group/type/SourceGroupSettingsUnloadable.h

settings/source_group/SourceGroupSettings.cpp
Expand Down Expand Up @@ -661,3 +618,67 @@ if (WIN32)
utility/utilityWindows.h
)
endif()

if (BUILD_CXX_LANGUAGE_PACKAGE)
add_files(
LIB

settings/source_group/component/cxx/SourceGroupSettingsWithCppStandard.cpp
settings/source_group/component/cxx/SourceGroupSettingsWithCppStandard.h
settings/source_group/component/cxx/SourceGroupSettingsWithCStandard.cpp
settings/source_group/component/cxx/SourceGroupSettingsWithCStandard.h
settings/source_group/component/cxx/SourceGroupSettingsWithCxxCdbPath.cpp
settings/source_group/component/cxx/SourceGroupSettingsWithCxxCdbPath.h
settings/source_group/component/cxx/SourceGroupSettingsWithCxxCodeblocksPath.cpp
settings/source_group/component/cxx/SourceGroupSettingsWithCxxCodeblocksPath.h
settings/source_group/component/cxx/SourceGroupSettingsWithCxxCrossCompilationOptions.cpp
settings/source_group/component/cxx/SourceGroupSettingsWithCxxCrossCompilationOptions.h
settings/source_group/component/cxx/SourceGroupSettingsWithCxxPathsAndFlags.cpp
settings/source_group/component/cxx/SourceGroupSettingsWithCxxPathsAndFlags.h
settings/source_group/component/cxx/SourceGroupSettingsWithCxxPchOptions.cpp
settings/source_group/component/cxx/SourceGroupSettingsWithCxxPchOptions.h
settings/source_group/component/cxx/SourceGroupSettingsWithIndexedHeaderPaths.cpp
settings/source_group/component/cxx/SourceGroupSettingsWithIndexedHeaderPaths.h
settings/source_group/component/cxx/SourceGroupSettingsWithSourceExtensionsC.h
settings/source_group/component/cxx/SourceGroupSettingsWithSourceExtensionsCpp.h

settings/source_group/type/SourceGroupSettingsCEmpty.h
settings/source_group/type/SourceGroupSettingsCppEmpty.h
settings/source_group/type/SourceGroupSettingsCustomCommand.h
settings/source_group/type/SourceGroupSettingsCxxCdb.h
settings/source_group/type/SourceGroupSettingsCxxCdbVs.h
settings/source_group/type/SourceGroupSettingsCxxCodeblocks.h
)
endif()

if (BUILD_JAVA_LANGUAGE_PACKAGE)
add_files(
LIB

settings/source_group/component/java/SourceGroupSettingsWithClasspath.cpp
settings/source_group/component/java/SourceGroupSettingsWithClasspath.h
settings/source_group/component/java/SourceGroupSettingsWithJavaGradle.cpp
settings/source_group/component/java/SourceGroupSettingsWithJavaGradle.h
settings/source_group/component/java/SourceGroupSettingsWithJavaMaven.cpp
settings/source_group/component/java/SourceGroupSettingsWithJavaMaven.h
settings/source_group/component/java/SourceGroupSettingsWithJavaStandard.cpp
settings/source_group/component/java/SourceGroupSettingsWithJavaStandard.h
settings/source_group/component/java/SourceGroupSettingsWithSourceExtensionsJava.h

settings/source_group/type/SourceGroupSettingsJavaEmpty.h
settings/source_group/type/SourceGroupSettingsJavaGradle.h
settings/source_group/type/SourceGroupSettingsJavaMaven.h
)
endif()

if (BUILD_PYTHON_LANGUAGE_PACKAGE)
add_files(
LIB

settings/source_group/component/python/SourceGroupSettingsWithPythonEnvironmentPath.cpp
settings/source_group/component/python/SourceGroupSettingsWithPythonEnvironmentPath.h
settings/source_group/component/python/SourceGroupSettingsWithSourceExtensionsPython.h

settings/source_group/type/SourceGroupSettingsPythonEmpty.h
)
endif()
21 changes: 15 additions & 6 deletions src/lib/settings/ProjectSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,29 @@
#include "SettingsMigrationDeleteKey.h"
#include "SettingsMigrationLambda.h"
#include "SettingsMigrationMoveKey.h"
#include "SourceGroupSettingsCustomCommand.h"
#include "SourceGroupSettingsUnloadable.h"
#include "logging.h"
#include "utilityFile.h"
#include "utilityString.h"
#include "utilityUuid.h"

#if BUILD_CXX_LANGUAGE_PACKAGE
#include "SourceGroupSettingsCEmpty.h"
#include "SourceGroupSettingsCppEmpty.h"
#include "SourceGroupSettingsCustomCommand.h"
#include "SourceGroupSettingsCxxCdb.h"
#include "SourceGroupSettingsCxxCodeblocks.h"
#endif // BUILD_CXX_LANGUAGE_PACKAGE

#if BUILD_JAVA_LANGUAGE_PACKAGE
#include "SourceGroupSettingsJavaEmpty.h"
#include "SourceGroupSettingsJavaMaven.h"
#include "SourceGroupSettingsJavaGradle.h"
#endif // BUILD_JAVA_LANGUAGE_PACKAGE

#if BUILD_PYTHON_LANGUAGE_PACKAGE
#include "SourceGroupSettingsPythonEmpty.h"
#include "SourceGroupSettingsUnloadable.h"
#include "logging.h"
#include "utilityFile.h"
#include "utilityString.h"
#include "utilityUuid.h"
#endif // BUILD_PYTHON_LANGUAGE_PACKAGE

const std::wstring ProjectSettings::PROJECT_FILE_EXTENSION = L".srctrlprj";
const std::wstring ProjectSettings::BOOKMARK_DB_FILE_EXTENSION = L".srctrlbm";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "SourceGroupSettingsWithCStandard.h"

#if BUILD_CXX_LANGUAGE_PACKAGE

#include "ProjectSettings.h"

std::wstring SourceGroupSettingsWithCStandard::getDefaultCStandardStatic()
Expand Down Expand Up @@ -69,5 +67,3 @@ std::wstring SourceGroupSettingsWithCStandard::getDefaultCStandard() const
{
return getDefaultCStandardStatic();
}

#endif // BUILD_CXX_LANGUAGE_PACKAGE
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_C_STANDARD_H
#define SOURCE_GROUP_SETTINGS_WITH_C_STANDARD_H

#include "language_packages.h"

#if BUILD_CXX_LANGUAGE_PACKAGE

#include <vector>

#include "SourceGroupSettingsComponent.h"
Expand Down Expand Up @@ -34,6 +30,4 @@ class SourceGroupSettingsWithCStandard
std::wstring m_cStandard;
};

#endif // BUILD_CXX_LANGUAGE_PACKAGE

#endif // SOURCE_GROUP_SETTINGS_WITH_C_STANDARD_H
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "SourceGroupSettingsWithCppStandard.h"

#if BUILD_CXX_LANGUAGE_PACKAGE

#include "ProjectSettings.h"

std::wstring SourceGroupSettingsWithCppStandard::getDefaultCppStandardStatic()
Expand Down Expand Up @@ -69,5 +67,3 @@ std::wstring SourceGroupSettingsWithCppStandard::getDefaultCppStandard() const
{
return getDefaultCppStandardStatic();
}

#endif // BUILD_CXX_LANGUAGE_PACKAGE
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_CPP_STANDARD_H
#define SOURCE_GROUP_SETTINGS_WITH_CPP_STANDARD_H

#include "language_packages.h"

#if BUILD_CXX_LANGUAGE_PACKAGE

#include <vector>

#include "SourceGroupSettingsComponent.h"
Expand Down Expand Up @@ -34,6 +30,4 @@ class SourceGroupSettingsWithCppStandard
std::wstring m_cppStandard;
};

#endif // BUILD_CXX_LANGUAGE_PACKAGE

#endif // SOURCE_GROUP_SETTINGS_WITH_CPP_STANDARD_H
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "SourceGroupSettingsWithCxxCdbPath.h"

#if BUILD_CXX_LANGUAGE_PACKAGE

#include "ProjectSettings.h"
#include "utilityFile.h"

Expand Down Expand Up @@ -41,5 +39,3 @@ void SourceGroupSettingsWithCxxCdbPath::save(ConfigManager* config, const std::s
{
config->setValue(key + "/build_file_path/compilation_db_path", getCompilationDatabasePath().wstr());
}

#endif // BUILD_CXX_LANGUAGE_PACKAGE
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_CXX_CDB_PATH_H
#define SOURCE_GROUP_SETTINGS_WITH_CXX_CDB_PATH_H

#include "language_packages.h"

#if BUILD_CXX_LANGUAGE_PACKAGE

#include "FilePath.h"
#include "SourceGroupSettingsComponent.h"

Expand All @@ -28,6 +24,4 @@ class SourceGroupSettingsWithCxxCdbPath
FilePath m_compilationDatabasePath;
};

#endif // BUILD_CXX_LANGUAGE_PACKAGE

#endif // SOURCE_GROUP_SETTINGS_WITH_CXX_CDB_PATH_H
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "SourceGroupSettingsWithCxxCodeblocksPath.h"

#if BUILD_CXX_LANGUAGE_PACKAGE

#include "ProjectSettings.h"
#include "utilityFile.h"

Expand Down Expand Up @@ -40,5 +38,3 @@ void SourceGroupSettingsWithCxxCodeblocksPath::save(ConfigManager* config, const
{
config->setValue(key + "/codeblocks_project_path", getCodeblocksProjectPath().wstr());
}

#endif // BUILD_CXX_LANGUAGE_PACKAGE
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_CXX_CODEBLOCKS_PATH_H
#define SOURCE_GROUP_SETTINGS_WITH_CXX_CODEBLOCKS_PATH_H

#include "language_packages.h"

#if BUILD_CXX_LANGUAGE_PACKAGE

#include "FilePath.h"
#include "SourceGroupSettingsComponent.h"

Expand All @@ -28,6 +24,4 @@ class SourceGroupSettingsWithCxxCodeblocksPath
FilePath m_codeblocksProjectPath;
};

#endif // BUILD_CXX_LANGUAGE_PACKAGE

#endif // SOURCE_GROUP_SETTINGS_WITH_CXX_CODEBLOCKS_PATH_H
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "SourceGroupSettingsWithCxxCrossCompilationOptions.h"

#if BUILD_CXX_LANGUAGE_PACKAGE

#include "ProjectSettings.h"

std::vector<std::wstring> SourceGroupSettingsWithCxxCrossCompilationOptions::getAvailableArchTypes()
Expand Down Expand Up @@ -233,5 +231,3 @@ void SourceGroupSettingsWithCxxCrossCompilationOptions::save(ConfigManager* conf
config->setValue(key + "/cross_compilation/target/sys", getTargetSys());
config->setValue(key + "/cross_compilation/target/abi", getTargetAbi());
}

#endif // BUILD_CXX_LANGUAGE_PACKAGE
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_CXX_CROSS_COMPILATION_OPTIONS_H
#define SOURCE_GROUP_SETTINGS_WITH_CXX_CROSS_COMPILATION_OPTIONS_H

#include "language_packages.h"

#if BUILD_CXX_LANGUAGE_PACKAGE

#include <vector>

#include "SourceGroupSettingsComponent.h"
Expand Down Expand Up @@ -51,6 +47,4 @@ class SourceGroupSettingsWithCxxCrossCompilationOptions
std::wstring m_targetAbi;
};

#endif // BUILD_CXX_LANGUAGE_PACKAGE

#endif // SOURCE_GROUP_SETTINGS_WITH_CXX_CROSS_COMPILATION_OPTIONS_H
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "SourceGroupSettingsWithCxxPathsAndFlags.h"

#if BUILD_CXX_LANGUAGE_PACKAGE

#include "ProjectSettings.h"
#include "utility.h"

Expand Down Expand Up @@ -71,5 +69,3 @@ void SourceGroupSettingsWithCxxPathsAndFlags::save(ConfigManager* config, const
config->setValues(key + "/framework_search_paths/framework_search_path", getFrameworkSearchPaths());
config->setValues(key + "/compiler_flags/compiler_flag", getCompilerFlags());
}

#endif // BUILD_CXX_LANGUAGE_PACKAGE
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_CXX_PATHS_AND_FLAGS_H
#define SOURCE_GROUP_SETTINGS_WITH_CXX_PATHS_AND_FLAGS_H

#include "language_packages.h"

#if BUILD_CXX_LANGUAGE_PACKAGE

#include <vector>

#include "FilePath.h"
Expand Down Expand Up @@ -39,6 +35,4 @@ class SourceGroupSettingsWithCxxPathsAndFlags
std::vector<std::wstring> m_compilerFlags;
};

#endif // BUILD_CXX_LANGUAGE_PACKAGE

#endif // SOURCE_GROUP_SETTINGS_WITH_CXX_PATHS_AND_FLAGS_H
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "SourceGroupSettingsWithCxxPchOptions.h"

#if BUILD_CXX_LANGUAGE_PACKAGE

#include "ProjectSettings.h"
#include "utility.h"
#include "utilityFile.h"
Expand Down Expand Up @@ -72,5 +70,3 @@ void SourceGroupSettingsWithCxxPchOptions::setPchFlags(const std::vector<std::ws
{
m_pchFlags = pchFlags;
}

#endif // BUILD_CXX_LANGUAGE_PACKAGE
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#ifndef SOURCE_GROUP_SETTINGS_WITH_CXX_PCH_OPTIONS_H
#define SOURCE_GROUP_SETTINGS_WITH_CXX_PCH_OPTIONS_H

#include "language_packages.h"

#if BUILD_CXX_LANGUAGE_PACKAGE

#include "FilePath.h"
#include "SourceGroupSettingsComponent.h"

Expand Down Expand Up @@ -38,6 +34,4 @@ class SourceGroupSettingsWithCxxPchOptions
bool m_useCompilerFlags = true;
};

#endif // BUILD_CXX_LANGUAGE_PACKAGE

#endif // SOURCE_GROUP_SETTINGS_WITH_CXX_PCH_OPTIONS_H
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "SourceGroupSettingsWithIndexedHeaderPaths.h"

#if BUILD_CXX_LANGUAGE_PACKAGE

#include "ProjectSettings.h"
#include "utility.h"

Expand Down Expand Up @@ -40,5 +38,3 @@ void SourceGroupSettingsWithIndexedHeaderPaths::save(ConfigManager* config, cons
{
config->setValues(key + "/indexed_header_paths/indexed_header_path", getIndexedHeaderPaths());
}

#endif // BUILD_CXX_LANGUAGE_PACKAGE
Loading

0 comments on commit bb40bcf

Please sign in to comment.