-
Notifications
You must be signed in to change notification settings - Fork 501
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
build: improve the Linux aspect of things #75
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 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,20 @@ | ||
# SPDX-FileCopyrightText: 2022 Andrea Pappacoda <andrea@pappacoda.it> | ||
# SPDX-License-Identifier: ISC | ||
|
||
find_package(PkgConfig) | ||
|
||
if (PKG_CONFIG_FOUND) | ||
pkg_search_module(zarchive IMPORTED_TARGET GLOBAL zarchive) | ||
if (zarchive_FOUND) | ||
add_library(ZArchive::zarchive ALIAS PkgConfig::zarchive) | ||
endif() | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(ZArchive | ||
REQUIRED_VARS | ||
zarchive_LINK_LIBRARIES | ||
zarchive_FOUND | ||
VERSION_VAR | ||
zarchive_VERSION | ||
) |
This file contains 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,27 @@ | ||
# SPDX-FileCopyrightText: 2022 Andrea Pappacoda <andrea@pappacoda.it> | ||
# SPDX-License-Identifier: ISC | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
find_package(imgui CONFIG) | ||
if (imgui_FOUND) | ||
# Use upstream imguiConfig.cmake if possible | ||
find_package_handle_standard_args(imgui CONFIG_MODE) | ||
else() | ||
# Fallback to pkg-config otherwise | ||
find_package(PkgConfig) | ||
if (PKG_CONFIG_FOUND) | ||
pkg_search_module(imgui IMPORTED_TARGET GLOBAL imgui) | ||
if (imgui_FOUND) | ||
add_library(imgui::imgui ALIAS PkgConfig::imgui) | ||
endif() | ||
endif() | ||
|
||
find_package_handle_standard_args(imgui | ||
REQUIRED_VARS | ||
imgui_LINK_LIBRARIES | ||
imgui_FOUND | ||
VERSION_VAR | ||
imgui_VERSION | ||
) | ||
endif() |
This file contains 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,49 @@ | ||
# SPDX-FileCopyrightText: 2022 Andrea Pappacoda <andrea@pappacoda.it> | ||
# SPDX-License-Identifier: ISC | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package(wxWidgets CONFIG COMPONENTS ${wxWidgets_FIND_COMPONENTS}) | ||
|
||
if (wxWidgets_FOUND) | ||
# Use upstream wxWidgetsConfig.cmake if possible | ||
find_package_handle_standard_args(wxWidgets CONFIG_MODE) | ||
else() | ||
# Fall back to CMake's FindwxWidgets | ||
# Temporarily unset CMAKE_MODULE_PATH to avoid calling the current find | ||
# module recursively | ||
set(_tmp_module_path "${CMAKE_MODULE_PATH}") | ||
set(CMAKE_MODULE_PATH "") | ||
|
||
find_package(wxWidgets MODULE QUIET COMPONENTS ${wxWidgets_FIND_COMPONENTS}) | ||
|
||
set(CMAKE_MODULE_PATH "${_tmp_module_path}") | ||
unset(_tmp_module_path) | ||
|
||
if (wxWidgets_FOUND) | ||
add_library(wx::base IMPORTED INTERFACE) | ||
target_include_directories(wx::base INTERFACE ${wxWidgets_INCLUDE_DIRS}) | ||
target_link_libraries(wx::base INTERFACE ${wxWidgets_LIBRARIES}) | ||
target_link_directories(wx::base INTERFACE ${wxWidgets_LIBRARY_DIRS}) | ||
target_compile_definitions(wx::base INTERFACE ${wxWidgets_DEFINITIONS}) | ||
target_compile_options(wx::base INTERFACE ${wxWidgets_CXX_FLAGS}) | ||
|
||
# FindwxWidgets sets everything into a single set of variables, so it is | ||
# impossible to tell what libraries are required for what component. | ||
# To be compatible with wxWidgetsConfig, we create an alias for each | ||
# component so that the user can still use target_link_libraries(wx::gl) | ||
foreach(component ${wxWidgets_FIND_COMPONENTS}) | ||
if (NOT component STREQUAL "base") | ||
# don't alias base to itself | ||
add_library(wx::${component} ALIAS wx::base) | ||
endif() | ||
endforeach() | ||
endif() | ||
|
||
find_package_handle_standard_args(wxWidgets | ||
REQUIRED_VARS | ||
wxWidgets_LIBRARIES | ||
wxWidgets_FOUND | ||
VERSION_VAR | ||
wxWidgets_VERSION_STRING | ||
) | ||
endif() |
This file contains 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,33 @@ | ||
# SPDX-FileCopyrightText: 2022 Andrea Pappacoda <andrea@pappacoda.it> | ||
# SPDX-License-Identifier: ISC | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
find_package(zstd CONFIG) | ||
if (zstd_FOUND) | ||
# Use upstream zstdConfig.cmake if possible | ||
if (NOT TARGET zstd::zstd) | ||
if (TARGET zstd::libzstd_static) | ||
add_library(zstd::zstd ALIAS zstd::libzstd_static) | ||
elseif (TARGET zstd::libzstd_shared) | ||
add_library(zstd::zstd ALIAS zstd::libzstd_shared) | ||
endif() | ||
endif() | ||
find_package_handle_standard_args(zstd CONFIG_MODE) | ||
else() | ||
# Fallback to pkg-config otherwise | ||
find_package(PkgConfig) | ||
if (PKG_CONFIG_FOUND) | ||
pkg_search_module(libzstd IMPORTED_TARGET GLOBAL libzstd) | ||
if (libzstd_FOUND) | ||
add_library(zstd::zstd ALIAS PkgConfig::libzstd) | ||
endif() | ||
endif() | ||
|
||
find_package_handle_standard_args(zstd | ||
REQUIRED_VARS | ||
libzstd_LINK_LIBRARIES | ||
libzstd_FOUND | ||
VERSION_VAR libzstd_VERSION | ||
) | ||
endif() |
This file contains 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 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 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 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.
I have to remove
SDL2::SDL2main
on Gentoo to get past this line.