-
Notifications
You must be signed in to change notification settings - Fork 1.5k
CMake cleanup #7658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
pfultz2
wants to merge
25
commits into
danmar:main
Choose a base branch
from
pfultz2:cmake-cleanup
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
CMake cleanup #7658
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
a72f0e8
CMake cleanup
pfultz2 7536500
Add missing cmake file
pfultz2 9524828
Fix cmake
pfultz2 aae3fa0
Consistent link libraries
pfultz2 e5f8f8c
Use object library
pfultz2 599a54e
Use targets
pfultz2 74f853f
Remove const to fix cast
pfultz2 91afb23
Remove noreturn
pfultz2 00c462a
Fix pcre linking
pfultz2 0e7f402
Add frontend
pfultz2 ca5c192
Remove SYSTEM
pfultz2 be40581
Disable precompile headers for now
pfultz2 e690613
Remove OBJECT
pfultz2 151d3d0
Use target_external_include_directories
pfultz2 0276fd8
Update target name
pfultz2 25d8719
Add verbose flag
pfultz2 f95486d
Remove interface library
pfultz2 5416baa
Make cli available for dmake
pfultz2 063a2f8
Fix issues with building with cli disabled
pfultz2 5a27cca
Remove verbose flag
pfultz2 a4b579d
Remove foreach loop
pfultz2 c645209
Merge branch 'main' into cmake-cleanup
pfultz2 b8bd740
Merge
pfultz2 f211acd
Add back const
pfultz2 5c47f9e
Remove line
pfultz2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
add_library(picojson INTERFACE) | ||
target_externals_include_directories(picojson INTERFACE .) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
file(GLOB hdrs "*.h") | ||
file(GLOB srcs "*.cpp") | ||
|
||
add_library(simplecpp_objs OBJECT ${srcs} ${hdrs}) | ||
if (BUILD_CORE_DLL) | ||
target_compile_definitions(simplecpp_objs PRIVATE SIMPLECPP_EXPORT) | ||
endif() | ||
add_library(simplecpp ${srcs} ${hdrs}) | ||
target_dll_compile_definitions(simplecpp EXPORT SIMPLECPP_EXPORT IMPORT SIMPLECPP_IMPORT) | ||
|
||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
target_compile_options_safe(simplecpp_objs -Wno-zero-as-null-pointer-constant) | ||
target_compile_options_safe(simplecpp -Wno-zero-as-null-pointer-constant) | ||
endif() | ||
|
||
target_externals_include_directories(simplecpp PUBLIC .) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
file(GLOB hdrs "*.h") | ||
file(GLOB srcs "*.cpp") | ||
|
||
add_library(tinyxml2_objs OBJECT ${srcs} ${hdrs}) | ||
if (BUILD_CORE_DLL) | ||
target_compile_definitions(tinyxml2_objs PRIVATE TINYXML2_EXPORT) | ||
endif() | ||
add_library(tinyxml2 ${srcs} ${hdrs}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be able to become a shared library. |
||
target_dll_compile_definitions(tinyxml2 EXPORT TINYXML2_EXPORT IMPORT TINYXML2_IMPORT) | ||
|
||
# TODO: needs to be fixed upstream | ||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") | ||
target_compile_options(tinyxml2_objs PRIVATE -Wno-suggest-attribute=format) | ||
target_compile_options(tinyxml2_objs PRIVATE -Wno-useless-cast) | ||
target_compile_options(tinyxml2 PRIVATE -Wno-suggest-attribute=format) | ||
target_compile_options(tinyxml2 PRIVATE -Wno-useless-cast) | ||
endif() | ||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
target_compile_options_safe(tinyxml2_objs -Wno-implicit-fallthrough) | ||
target_compile_options_safe(tinyxml2_objs -Wno-suggest-destructor-override) | ||
target_compile_options_safe(tinyxml2_objs -Wno-zero-as-null-pointer-constant) | ||
target_compile_options_safe(tinyxml2_objs -Wno-format-nonliteral) | ||
target_compile_options_safe(tinyxml2_objs -Wno-inconsistent-missing-destructor-override) | ||
target_compile_options_safe(tinyxml2 -Wno-implicit-fallthrough) | ||
target_compile_options_safe(tinyxml2 -Wno-suggest-destructor-override) | ||
target_compile_options_safe(tinyxml2 -Wno-zero-as-null-pointer-constant) | ||
target_compile_options_safe(tinyxml2 -Wno-format-nonliteral) | ||
target_compile_options_safe(tinyxml2 -Wno-inconsistent-missing-destructor-override) | ||
endif() | ||
if(CYGWIN) | ||
target_compile_definitions(-D_LARGEFILE_SOURCE) # required for fseeko() and ftello() | ||
endif() | ||
|
||
target_externals_include_directories(tinyxml2 PUBLIC .) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
file(GLOB hdrs "*.h") | ||
file(GLOB srcs "*.cpp") | ||
|
||
add_library(frontend_objs OBJECT ${hdrs} ${srcs}) | ||
target_include_directories(frontend_objs PRIVATE ${PROJECT_SOURCE_DIR}/lib) | ||
add_library(frontend ${hdrs} ${srcs}) | ||
target_include_directories(frontend PUBLIC .) | ||
target_link_libraries(frontend PRIVATE cppcheck-core) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be able to become a shared library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will if we set
BUILD_SHARED_LIBS
.