-
Notifications
You must be signed in to change notification settings - Fork 122
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
7 changed files
with
121 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) | ||
|
||
project (winflexbison) | ||
|
||
if(NOT MSVC) | ||
message( FATAL_ERROR "Visual Studio Build supported only" ) | ||
endif() | ||
|
||
# Output Variables | ||
set(OUTPUT_DEBUG "${CMAKE_CURRENT_LIST_DIR}/bin/Debug") | ||
set(OUTPUT_RELEASE "${CMAKE_CURRENT_LIST_DIR}/bin/Release") | ||
|
||
add_definitions(-D_CRT_SECURE_NO_WARNINGS) | ||
|
||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DEBUG}") | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_RELEASE}") | ||
|
||
if(CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
add_definitions(-D_DEBUG) | ||
endif() | ||
|
||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W3 /MD /Od /Zi /EHsc") | ||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W3 /GL /Od /Oi /Gy /Zi /EHsc") | ||
|
||
# Define Release by default. | ||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE "Release") | ||
message(STATUS "Build type not specified: Use Release by default.") | ||
endif() | ||
|
||
add_subdirectory(common) | ||
add_subdirectory(flex) | ||
add_subdirectory(bison) |
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,22 @@ | ||
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) | ||
|
||
set(PROJECT_NAME win_bison) | ||
|
||
project(${PROJECT_NAME} C) | ||
|
||
# Definition of Macros | ||
add_definitions(-D_CONSOLE) | ||
|
||
file(GLOB SOURCE_FILES | ||
"src/*.c" | ||
"src/*.h" | ||
) | ||
|
||
# Add executable to build. | ||
add_executable(${PROJECT_NAME} | ||
${SOURCE_FILES} | ||
) | ||
|
||
target_include_directories(${PROJECT_NAME} PRIVATE "src") | ||
|
||
target_link_libraries(${PROJECT_NAME} common_lib kernel32.lib user32.lib) |
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,4 @@ | ||
mkdir CMakeBuildVS2015 | ||
cd CMakeBuildVS2015 | ||
cmake .. -G "Visual Studio 14 2015" | ||
cd .. |
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,4 @@ | ||
mkdir CMakeBuildVS2017 | ||
cd CMakeBuildVS2017 | ||
cmake .. -G "Visual Studio 15 2017" | ||
cd .. |
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,30 @@ | ||
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) | ||
|
||
set(PROJECT_NAME common_lib) | ||
|
||
project(${PROJECT_NAME} C) | ||
|
||
# Definition of Macros | ||
add_definitions(-D_LIB) | ||
|
||
file(GLOB SOURCE_FILES | ||
"misc/*.c" | ||
"misc/*.h" | ||
"m4/*.c" | ||
"m4/*.h" | ||
"m4/lib/*.c" | ||
"m4/lib/*.h" | ||
) | ||
# exclude some source files | ||
list(REMOVE_ITEM SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/m4/lib/regexec.c") | ||
list(REMOVE_ITEM SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/m4/lib/regcomp.c") | ||
|
||
# Add library to build. | ||
add_library(${PROJECT_NAME} STATIC | ||
${SOURCE_FILES} | ||
) | ||
|
||
target_include_directories(${PROJECT_NAME} PUBLIC "misc") | ||
target_include_directories(${PROJECT_NAME} PUBLIC "m4") | ||
target_include_directories(${PROJECT_NAME} PUBLIC "m4/lib") | ||
|
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,25 @@ | ||
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR) | ||
|
||
set(PROJECT_NAME win_flex) | ||
|
||
project(${PROJECT_NAME} C) | ||
|
||
# Definition of Macros | ||
add_definitions(-D_CONSOLE) | ||
|
||
file(GLOB SOURCE_FILES | ||
"src/*.c" | ||
"src/*.h" | ||
) | ||
# exclude some source files | ||
list(REMOVE_ITEM SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/libmain.c") | ||
list(REMOVE_ITEM SOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/src/libyywrap.c") | ||
|
||
# Add executable to build. | ||
add_executable(${PROJECT_NAME} | ||
${SOURCE_FILES} | ||
) | ||
|
||
target_include_directories(${PROJECT_NAME} PRIVATE "src") | ||
|
||
target_link_libraries(${PROJECT_NAME} common_lib kernel32.lib user32.lib) |