-
Notifications
You must be signed in to change notification settings - Fork 24
Add x64-linux triplets and toolchains #127
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
LelandJin
wants to merge
3
commits into
carbonengine:main
Choose a base branch
from
LelandJin:x64-linux-support
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
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # Copyright © 2025 CCP ehf. | ||
| if (NOT _CCP_TOOLCHAIN_FILE_LOADED) | ||
| set(_CCP_TOOLCHAIN_FILE_LOADED 1) | ||
|
|
||
| set (VCPKG_USE_HOST_TOOLS ON CACHE STRING "") | ||
| set (CMAKE_CXX_STANDARD 17 CACHE STRING "") | ||
| set (CMAKE_CXX_STANDARD_REQUIRED ON CACHE STRING "") | ||
| set (CMAKE_CXX_EXTENSIONS OFF CACHE STRING "") | ||
| set (CMAKE_POSITION_INDEPENDENT_CODE ON CACHE STRING "") | ||
| set (CMAKE_CXX_VISIBILITY_PRESET hidden CACHE STRING "") | ||
| set (CMAKE_INTERPROCEDURAL_OPTIMIZATION ON CACHE STRING "") | ||
|
|
||
| #[[ | ||
| - `CCP_PLATFORM` indicates the operating system a binary was built for | ||
| - `CCP_ARCHITECTURE` indicates the hardware architecture a binary was built for | ||
| - `CCP_TOOLSET` indicates the compiler (or toolset) a binary was built with | ||
| - `CCP_VENDOR_LIB_PATH` is a convenience variable for find_package modules, to construct the default `lib` folder for a vendored SDK. | ||
| - `CCP_VENDOR_BIN_PATH` is the same as CCP_VENDOR_LIB_PATH, but for the `bin` folder for a vendored SDK. | ||
|
|
||
| See Platform Agnostic Developement section of the wiki: | ||
| https://ccpgames.atlassian.net/wiki/spaces/PAD/overview?homepageId=171868162 | ||
| ]] | ||
| set(CCP_PLATFORM "Linux" CACHE STRING "Target Platform") | ||
| set(CCP_ARCHITECTURE "x64" CACHE STRING "Target Architecture") | ||
| set(CCP_TOOLSET "GNU" CACHE STRING "Target Toolset") | ||
|
|
||
| # adjust warning settings for all our projects, but do not treat them as errors just yet. | ||
| add_compile_options(-Wall) | ||
| # we want to use the two ones below once we're good with -Wall | ||
| # add_compile_options(-Wpedantic) | ||
| # add_compile_options(-Wextra) | ||
|
|
||
| # We're using a lot of MSVC specific pragmas in our codebase, so we silence those warnings until we got around to | ||
| # cleaning them up | ||
| add_compile_options(-Wno-unknown-pragmas) | ||
| # There's a surprising amount of unused functions, we need to investigate this deeper at one point | ||
| add_compile_options(-Wno-unused-function) | ||
| # Ditto, much like the functions there are also a lot of unused variables it appears | ||
| add_compile_options(-Wno-unused-variable) | ||
| # We've not been very good at keeping order | ||
| add_compile_options(-Wno-reorder) | ||
| # -Wmissing-braces should only be used by C / ObjectiveC, but for some reason it shows up for our C++ code, too. | ||
| add_compile_options(-Wno-missing-braces) | ||
|
|
||
| # Manually add debug symbols to builds | ||
| add_compile_options(-g) | ||
|
|
||
| if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") | ||
| if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "13") | ||
| set(MATH_OPTIMIZE_FLAG -ffast-math -fhonor-infinities -fhonor-nans) | ||
| else() | ||
| set(MATH_OPTIMIZE_FLAG -ffast-math -ffp-model=fast -fhonor-infinities -fhonor-nans) | ||
| endif() | ||
| else() | ||
| # GCC has no -fhonor-infinities/-fhonor-nans; -ffast-math implies -ffinite-math-only, | ||
| # so undo that part to keep Inf/NaN honored like the Clang platforms. | ||
| set(MATH_OPTIMIZE_FLAG -ffast-math -fno-finite-math-only) | ||
| endif() | ||
| endif () | ||
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 @@ | ||
| # Copyright © 2025 CCP ehf. | ||
| # This toolchain is meant for use inside a vcpkg triplet. See `README.md` for more details. | ||
| include($ENV{PATH_TO_VCPKG_ROOT}/scripts/toolchains/linux.cmake) | ||
| include(${CMAKE_CURRENT_LIST_DIR}/../toolchains/x64-linux-carbon.cmake) |
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,92 @@ | ||
| # Copyright © 2025 CCP ehf. | ||
| set(VCPKG_TARGET_ARCHITECTURE x64) | ||
| set(VCPKG_CRT_LINKAGE dynamic) | ||
| set(VCPKG_LIBRARY_LINKAGE dynamic) | ||
| set(VCPKG_BUILD_TYPE "release") | ||
|
|
||
| set(VCPKG_CMAKE_SYSTEM_NAME Linux) | ||
|
LelandJin marked this conversation as resolved.
|
||
|
|
||
| # Changes in vcpkg-tool (https://github.com/microsoft/vcpkg-tool/pull/1931) removed the ability to access the VCPKG_ROOT | ||
| # environment variable from inside the VCPKG build environment while VCPKG_LOAD_VCVARS_ENV is set to ON. | ||
| # For consistency, we have changed this for both windows & macos. | ||
| # More information available here: https://github.com/carbonengine/vcpkg-registry/pull/34 | ||
| set(VCPKG_ENV_PASSTHROUGH_UNTRACKED PATH_TO_VCPKG_ROOT) | ||
|
|
||
| set(CARBON_BUILD_TYPE "Debug") | ||
|
|
||
| if (PORT MATCHES "carbon-.*") | ||
| set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/../toolchains/x64-linux-triplet.cmake") | ||
| set(VCPKG_HASH_ADDITIONAL_FILES "${CMAKE_CURRENT_LIST_DIR}/../toolchains/x64-linux-carbon.cmake") | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libyaml") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "ccd") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "curl") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "openssl") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "protobuf") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "zlib") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libuv") | ||
| set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DBUILD_TESTING=OFF") | ||
| endif() | ||
|
|
||
| if (PORT MATCHES "carbon-pdmprotowrapper") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "meshoptimizer") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "tinyfiledialogs") | ||
| set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_POLICY_VERSION_MINIMUM=3.5") | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libjpeg-turbo") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libsquish") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libpng") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "freetype") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "brotli") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "bzip2") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libogg") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libvorbis") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
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,92 @@ | ||
| # Copyright © 2025 CCP ehf. | ||
| set(VCPKG_TARGET_ARCHITECTURE x64) | ||
| set(VCPKG_CRT_LINKAGE dynamic) | ||
| set(VCPKG_LIBRARY_LINKAGE dynamic) | ||
| set(VCPKG_BUILD_TYPE "release") | ||
|
|
||
| set(VCPKG_CMAKE_SYSTEM_NAME Linux) | ||
|
|
||
| # Changes in vcpkg-tool (https://github.com/microsoft/vcpkg-tool/pull/1931) removed the ability to access the VCPKG_ROOT | ||
| # environment variable from inside the VCPKG build environment while VCPKG_LOAD_VCVARS_ENV is set to ON. | ||
| # For consistency, we have changed this for both windows & macos. | ||
| # More information available here: https://github.com/carbonengine/vcpkg-registry/pull/34 | ||
| set(VCPKG_ENV_PASSTHROUGH_UNTRACKED PATH_TO_VCPKG_ROOT) | ||
|
|
||
| set(CARBON_BUILD_TYPE "Internal") | ||
|
|
||
| if (PORT MATCHES "carbon-.*") | ||
| set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/../toolchains/x64-linux-triplet.cmake") | ||
| set(VCPKG_HASH_ADDITIONAL_FILES "${CMAKE_CURRENT_LIST_DIR}/../toolchains/x64-linux-carbon.cmake") | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libyaml") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "ccd") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "curl") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "openssl") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "protobuf") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "zlib") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libuv") | ||
| set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DBUILD_TESTING=OFF") | ||
| endif() | ||
|
|
||
| if (PORT MATCHES "carbon-pdmprotowrapper") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "meshoptimizer") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "tinyfiledialogs") | ||
| set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_POLICY_VERSION_MINIMUM=3.5") | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libjpeg-turbo") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libsquish") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libpng") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "freetype") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "brotli") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "bzip2") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libogg") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libvorbis") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () |
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,92 @@ | ||
| # Copyright © 2025 CCP ehf. | ||
| set(VCPKG_TARGET_ARCHITECTURE x64) | ||
| set(VCPKG_CRT_LINKAGE dynamic) | ||
| set(VCPKG_LIBRARY_LINKAGE dynamic) | ||
| set(VCPKG_BUILD_TYPE "release") | ||
|
|
||
| set(VCPKG_CMAKE_SYSTEM_NAME Linux) | ||
|
|
||
| # Changes in vcpkg-tool (https://github.com/microsoft/vcpkg-tool/pull/1931) removed the ability to access the VCPKG_ROOT | ||
| # environment variable from inside the VCPKG build environment while VCPKG_LOAD_VCVARS_ENV is set to ON. | ||
| # For consistency, we have changed this for both windows & macos. | ||
| # More information available here: https://github.com/carbonengine/vcpkg-registry/pull/34 | ||
| set(VCPKG_ENV_PASSTHROUGH_UNTRACKED PATH_TO_VCPKG_ROOT) | ||
|
|
||
| set(CARBON_BUILD_TYPE "Release") | ||
|
|
||
| if (PORT MATCHES "carbon-.*") | ||
| set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/../toolchains/x64-linux-triplet.cmake") | ||
| set(VCPKG_HASH_ADDITIONAL_FILES "${CMAKE_CURRENT_LIST_DIR}/../toolchains/x64-linux-carbon.cmake") | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libyaml") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "ccd") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "curl") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "openssl") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "protobuf") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "zlib") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libuv") | ||
| set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DBUILD_TESTING=OFF") | ||
| endif() | ||
|
|
||
| if (PORT MATCHES "carbon-pdmprotowrapper") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "meshoptimizer") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "tinyfiledialogs") | ||
| set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DCMAKE_POLICY_VERSION_MINIMUM=3.5") | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libjpeg-turbo") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libsquish") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libpng") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "freetype") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "brotli") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "bzip2") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libogg") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () | ||
|
|
||
| if (PORT MATCHES "libvorbis") | ||
| set(VCPKG_LIBRARY_LINKAGE static) | ||
| endif () |
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.
Uh oh!
There was an error while loading. Please reload this page.