-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2060 from Sonicadvance1/clang_thunks
Thunks: Add support for building with clang
- Loading branch information
Showing
8 changed files
with
61 additions
and
10 deletions.
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
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
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 |
---|---|---|
@@ -1,4 +1,20 @@ | ||
option(ENABLE_CLANG_THUNKS "Enable building thunks with clang" FALSE) | ||
|
||
set(CMAKE_SYSTEM_PROCESSOR i686) | ||
|
||
set(CMAKE_C_COMPILER x86_64-linux-gnu-gcc -m32) | ||
set(CMAKE_CXX_COMPILER x86_64-linux-gnu-g++ -m32) | ||
if (ENABLE_CLANG_THUNKS) | ||
message(STATUS "Enabling thunk clang building. Force enabling LLD as well") | ||
|
||
set(CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=lld") | ||
set(CMAKE_MODULE_LINKER_FLAGS_INIT "-fuse-ld=lld") | ||
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=lld") | ||
set(CMAKE_C_COMPILER clang) | ||
set(CMAKE_CXX_COMPILER clang++) | ||
set(CLANG_FLAGS "-target i686-linux-gnu -msse2 -mfpmath=sse") | ||
|
||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CLANG_FLAGS}") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CLANG_FLAGS}") | ||
else() | ||
set(CMAKE_C_COMPILER x86_64-linux-gnu-gcc -m32) | ||
set(CMAKE_CXX_COMPILER x86_64-linux-gnu-g++ -m32) | ||
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 |
---|---|---|
@@ -1,4 +1,20 @@ | ||
option(ENABLE_CLANG_THUNKS "Enable building thunks with clang" FALSE) | ||
|
||
set(CMAKE_SYSTEM_PROCESSOR x86_64) | ||
|
||
set(CMAKE_C_COMPILER x86_64-linux-gnu-gcc) | ||
set(CMAKE_CXX_COMPILER x86_64-linux-gnu-g++) | ||
if (ENABLE_CLANG_THUNKS) | ||
message(STATUS "Enabling thunk clang building. Force enabling LLD as well") | ||
|
||
set(CMAKE_EXE_LINKER_FLAGS_INIT "-fuse-ld=lld") | ||
set(CMAKE_MODULE_LINKER_FLAGS_INIT "-fuse-ld=lld") | ||
set(CMAKE_SHARED_LINKER_FLAGS_INIT "-fuse-ld=lld") | ||
set(CMAKE_C_COMPILER clang) | ||
set(CMAKE_CXX_COMPILER clang++) | ||
set(CLANG_FLAGS "-target x86_64-linux-gnu") | ||
|
||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CLANG_FLAGS}") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CLANG_FLAGS}") | ||
else() | ||
set(CMAKE_C_COMPILER x86_64-linux-gnu-gcc) | ||
set(CMAKE_CXX_COMPILER x86_64-linux-gnu-g++) | ||
endif() |