-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
943 additions
and
232 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,41 @@ | ||
cmake_minimum_required(VERSION 3.22) | ||
|
||
# Setup project | ||
project(LwLibPROJECT) | ||
|
||
# ------------------------------------------------- | ||
# This CMakeLists.txt is used only if it is a top-level file. | ||
# Purpose of it is to be able to compile project in standalone way only | ||
# | ||
# When library sources are to be included in another project | ||
# user shall use /lwrb/CMakeLists.txt instead | ||
if (NOT PROJECT_IS_TOP_LEVEL) | ||
message(FATAL_ERROR "This CMakeLists.txt can only be used as top-level. Use /lwrb/CMakeLists.txt for library include purpose") | ||
endif() | ||
|
||
# Set as executable | ||
add_executable(${PROJECT_NAME}) | ||
|
||
# Add key executable block | ||
target_sources(${PROJECT_NAME} PUBLIC | ||
${CMAKE_CURRENT_LIST_DIR}/dev/main.c | ||
) | ||
|
||
# Add key include paths | ||
target_include_directories(${PROJECT_NAME} PUBLIC | ||
${CMAKE_CURRENT_LIST_DIR}/dev | ||
) | ||
|
||
# Compilation definition information | ||
target_compile_definitions(${PROJECT_NAME} PUBLIC | ||
WIN32 | ||
_DEBUG | ||
CONSOLE | ||
LWRB_DEV | ||
) | ||
|
||
# Compiler options | ||
target_compile_options(${PROJECT_NAME} PRIVATE | ||
-Wall | ||
-Wextra | ||
-Wpedantic | ||
) | ||
|
||
# Add subdir with lwrb and link to project | ||
add_subdirectory("lwrb" lwrb) | ||
target_link_libraries(${PROJECT_NAME} lwrb) | ||
project(LwLibPROJECT C) | ||
|
||
if(NOT PROJECT_IS_TOP_LEVEL) | ||
add_subdirectory(lwrb) | ||
else() | ||
# Set as executable | ||
add_executable(${PROJECT_NAME}) | ||
|
||
# Add key executable block | ||
target_sources(${PROJECT_NAME} PUBLIC | ||
${CMAKE_CURRENT_LIST_DIR}/dev/main.c | ||
) | ||
|
||
# Add key include paths | ||
target_include_directories(${PROJECT_NAME} PUBLIC | ||
${CMAKE_CURRENT_LIST_DIR}/dev | ||
) | ||
|
||
# Compilation definition information | ||
target_compile_definitions(${PROJECT_NAME} PUBLIC | ||
WIN32 | ||
_DEBUG | ||
CONSOLE | ||
LWRB_DEV | ||
) | ||
|
||
# Compiler options | ||
target_compile_options(${PROJECT_NAME} PRIVATE | ||
-Wall | ||
-Wextra | ||
-Wpedantic | ||
) | ||
|
||
# Add subdir with lwrb and link to project | ||
add_subdirectory(lwrb) | ||
target_link_libraries(${PROJECT_NAME} lwrb) | ||
target_link_libraries(${PROJECT_NAME} lwrb_ex) | ||
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
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.