-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add /utf-8 flag when compiling with MSVC
- Loading branch information
1 parent
77f33ce
commit 52497bb
Showing
1 changed file
with
10 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
cmake_minimum_required(VERSION 3.20) | ||
set(CMAKE_CXX_STANDARD 20) | ||
set(TARGET_BINARY_NAME electra) | ||
|
||
if(NOT DEFINED CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Release) | ||
endif() | ||
|
||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
project(ElectraLang VERSION 1.0.0) | ||
|
||
file(GLOB SOURCE_FILES "./src/*.cpp") | ||
add_executable(electra ${SOURCE_FILES}) | ||
add_executable(${TARGET_BINARY_NAME} ${SOURCE_FILES}) | ||
|
||
target_include_directories(electra PUBLIC include) | ||
target_include_directories(${TARGET_BINARY_NAME} PUBLIC include) | ||
|
||
set(BOOST_REGEX_STANDALONE ON) | ||
add_subdirectory(include/thirdparty/regex) | ||
target_link_libraries(electra PRIVATE Boost::regex) | ||
target_link_libraries(${TARGET_BINARY_NAME} PRIVATE Boost::regex) | ||
|
||
if(WIN32) | ||
target_compile_definitions(${TARGET_BINARY_NAME} PRIVATE /utf-8) | ||
endif() | ||
|
||
if(NOT WIN32) | ||
install(TARGETS electra DESTINATION bin) | ||
install(TARGETS ${TARGET_BINARY_NAME} DESTINATION bin) | ||
endif() |